diff --git a/src/VMware/VMware.Autorest/Az.VMware.format.ps1xml b/src/VMware/VMware.Autorest/Az.VMware.format.ps1xml index c7dea5df7066..2587402beb61 100644 --- a/src/VMware/VMware.Autorest/Az.VMware.format.ps1xml +++ b/src/VMware/VMware.Autorest/Az.VMware.format.ps1xml @@ -2,187 +2,61 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMwareIdentity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMwareIdentity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon#Multiple - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - AddonName - - - AuthorizationName - - - CloudLinkName - - - ClusterName - - - DatastoreName - - - DhcpId - - - DnsServiceId - - - DnsZoneId - - - GatewayId - - - GlobalReachConnectionName - - - HcxEnterpriseSiteName - - - Location - - - PlacementPolicyName - - - PortMirroringId - - - PrivateCloudName - - - PublicIPId + Name ResourceGroupName - - ScriptCmdletName - - - ScriptExecutionName - - - ScriptPackageName - - - SegmentId - - - SubscriptionId - - - VMGroupId - - - VirtualMachineId - - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Addon + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonArcProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Addon + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonArcProperties#Multiple - + - + + + + - Name + AddonType - ResourceGroupName + ProvisioningState + + + VCenter @@ -190,9 +64,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonHcxProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonHcxProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonHcxProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonHcxProperties#Multiple @@ -224,9 +98,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonList#Multiple @@ -246,9 +120,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties#Multiple @@ -274,9 +148,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties#Multiple @@ -308,9 +182,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties#Multiple @@ -342,9 +216,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AdminCredentials + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AdminCredentials - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AdminCredentials + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AdminCredentials#Multiple @@ -370,9 +244,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityProperties#Multiple @@ -404,9 +278,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit#Multiple @@ -444,9 +318,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLink + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLink + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink#Multiple @@ -472,9 +346,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkList#Multiple @@ -494,9 +368,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkProperties#Multiple @@ -522,9 +396,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster#Multiple @@ -550,9 +424,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterList#Multiple @@ -572,9 +446,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterProperties#Multiple @@ -584,9 +458,6 @@ - - - @@ -600,9 +471,6 @@ ClusterSize - - Host - ProvisioningState @@ -612,18 +480,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdateProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdateProperties#Multiple - - - @@ -631,8 +496,27 @@ ClusterSize + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZone + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZone#Multiple + + + + + + + + + + - Host + Zone @@ -640,9 +524,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CommonClusterProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CommonClusterProperties#Multiple @@ -652,9 +536,6 @@ - - - @@ -668,9 +549,6 @@ ClusterSize - - Host - ProvisioningState @@ -680,9 +558,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Datastore + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Datastore + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore#Multiple @@ -720,9 +598,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreList#Multiple @@ -742,9 +620,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreProperties#Multiple @@ -770,9 +648,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolume + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolume + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolume#Multiple @@ -810,9 +688,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Encryption + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Encryption - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Encryption + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Encryption#Multiple @@ -832,12 +710,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultProperties#Multiple + + + @@ -857,6 +738,9 @@ + + AutoDetectedKeyVersion + KeyName @@ -878,9 +762,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Endpoints + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Endpoints - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Endpoints + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Endpoints#Multiple @@ -912,9 +796,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorization + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetail + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetail#Multiple + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorization + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization#Multiple @@ -940,9 +858,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationList#Multiple @@ -962,9 +880,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationProperties#Multiple @@ -1002,9 +920,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnection + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnection + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection#Multiple @@ -1030,9 +948,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionList#Multiple @@ -1052,9 +970,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionProperties#Multiple @@ -1104,9 +1022,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSite + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSite + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite#Multiple @@ -1132,9 +1050,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteList#Multiple @@ -1154,9 +1072,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteProperties#Multiple @@ -1182,9 +1100,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource#Multiple @@ -1258,9 +1176,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecification + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecification - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecification + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecification#Multiple @@ -1292,9 +1210,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ManagementCluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementCluster - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ManagementCluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementCluster#Multiple @@ -1304,9 +1222,6 @@ - - - @@ -1320,9 +1235,6 @@ ClusterSize - - Host - ProvisioningState @@ -1332,9 +1244,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricDimension + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricDimension - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricDimension + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricDimension#Multiple @@ -1372,9 +1284,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecification + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecification - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecification + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecification#Multiple @@ -1405,12 +1317,6 @@ - - - - - - @@ -1445,12 +1351,6 @@ SourceMdmNamespace - - SupportedAggregationType - - - SupportedTimeGrainType - Unit @@ -1460,9 +1360,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Operation + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Operation + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Operation#Multiple @@ -1494,9 +1394,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplay#Multiple @@ -1534,9 +1434,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationList#Multiple @@ -1556,9 +1456,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPoliciesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPoliciesList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPoliciesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPoliciesList#Multiple @@ -1578,9 +1478,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy#Multiple @@ -1606,9 +1506,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties#Multiple @@ -1640,33 +1540,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdateProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdateProperties#Multiple - + - + - + - HostMember + AffinityStrength - State + AzureHybridBenefitType - VMMember + State @@ -1674,9 +1574,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud#Multiple @@ -1708,9 +1608,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity#Multiple @@ -1736,9 +1636,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudList#Multiple @@ -1758,9 +1658,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudProperties#Multiple @@ -1779,6 +1679,9 @@ + + + @@ -1794,9 +1697,6 @@ - - - @@ -1806,15 +1706,15 @@ - - - + + + @@ -1855,6 +1755,9 @@ Internet + + KeyVaultPropertyAutoDetectedKeyVersion + KeyVaultPropertyKeyName @@ -1870,9 +1773,6 @@ KeyVaultPropertyVersionType - - ManagementClusterHost - ManagementClusterId @@ -1882,15 +1782,15 @@ ManagementClusterSize - - ExternalCloudLink - ManagementNetwork NetworkBlock + + NsxPublicIPQuotaRaised + NsxtCertificateThumbprint @@ -1918,9 +1818,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties#Multiple @@ -1940,9 +1840,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ProxyResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource#Multiple @@ -1962,9 +1862,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PsCredentialExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PsCredentialExecutionParameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PsCredentialExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PsCredentialExecutionParameter#Multiple @@ -1996,9 +1896,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Quota + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Quota - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Quota + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Quota#Multiple @@ -2018,9 +1918,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemaining + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemaining - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemaining + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemaining#Multiple @@ -2040,9 +1940,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource#Multiple @@ -2062,9 +1962,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTags + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags#Multiple @@ -2084,9 +1984,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdlet + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdlet - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdlet + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdlet#Multiple @@ -2112,9 +2012,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletProperties#Multiple @@ -2140,9 +2040,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletsList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletsList#Multiple @@ -2162,9 +2062,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution#Multiple @@ -2190,9 +2090,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter#Multiple @@ -2212,27 +2112,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionProperties#Multiple - - - - - - - - - @@ -2251,16 +2142,10 @@ - - - - - Error - FailureReason @@ -2268,13 +2153,7 @@ FinishedAt - Information - - - Output - - - ProvisioningState + ProvisioningState Retention @@ -2291,18 +2170,15 @@ Timeout - - Warning - - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionsList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionsList#Multiple @@ -2322,9 +2198,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackage + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackage - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackage + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackage#Multiple @@ -2350,15 +2226,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageProperties#Multiple + + + + + + @@ -2366,9 +2248,15 @@ + + Company + Description + + Uri + Version @@ -2378,9 +2266,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackagesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackagesList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackagesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackagesList#Multiple @@ -2400,9 +2288,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameter#Multiple @@ -2440,9 +2328,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter#Multiple @@ -2468,9 +2356,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter#Multiple @@ -2496,9 +2384,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku#Multiple @@ -2518,9 +2406,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.TrackedResource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.TrackedResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.TrackedResource#Multiple @@ -2546,9 +2434,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Trial + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Trial - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Trial + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Trial#Multiple @@ -2574,9 +2462,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachine + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachine - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachine + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachine#Multiple @@ -2602,9 +2490,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineProperties#Multiple @@ -2642,9 +2530,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineRestrictMovement + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineRestrictMovement - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineRestrictMovement + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineRestrictMovement#Multiple @@ -2664,9 +2552,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachinesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachinesList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachinesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachinesList#Multiple @@ -2686,9 +2574,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMHostPlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMHostPlacementPolicyProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMHostPlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMHostPlacementPolicyProperties#Multiple @@ -2702,13 +2590,13 @@ - + - + - + @@ -2724,13 +2612,13 @@ State - AffinityType + AffinityStrength - HostMember + AffinityType - VMMember + AzureHybridBenefitType @@ -2738,9 +2626,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties#Multiple @@ -2756,9 +2644,6 @@ - - - @@ -2775,8 +2660,171 @@ AffinityType + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMwareIdentity + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMwareIdentity#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AddonName + + + AuthorizationName + + + CloudLinkName + + + ClusterName + + + DatastoreName + + + DhcpId + + + DnsServiceId + + + DnsZoneId + + + GatewayId + + + GlobalReachConnectionName + + + HcxEnterpriseSiteName + + + Location + + + PlacementPolicyName + + + PortMirroringId + + + PrivateCloudName + + + PublicIPId + + + ResourceGroupName + + + ScriptCmdletName + + + ScriptExecutionName + + + ScriptPackageName + + + SegmentId + + + SubscriptionId + - VMMember + VMGroupId + + + VirtualMachineId + + + WorkloadNetworkName @@ -2784,9 +2832,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetwork - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetwork#Multiple @@ -2812,9 +2860,37 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp#Multiple + + + + + + + + + + + + + + + Name + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity#Multiple @@ -2830,9 +2906,6 @@ - - - @@ -2849,18 +2922,15 @@ Revision - - Segment - - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpList#Multiple @@ -2880,9 +2950,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpRelay + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpRelay - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpRelay + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpRelay#Multiple @@ -2898,12 +2968,6 @@ - - - - - - @@ -2920,21 +2984,15 @@ Revision - - Segment - - - ServerAddress - - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpServer + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpServer - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpServer + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpServer#Multiple @@ -2950,9 +3008,6 @@ - - - @@ -2975,9 +3030,6 @@ Revision - - Segment - LeaseTime @@ -2990,9 +3042,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService#Multiple @@ -3018,9 +3070,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceProperties#Multiple @@ -3033,9 +3085,6 @@ - - - @@ -3061,9 +3110,6 @@ DnsServiceIP - - FqdnZone - LogLevel @@ -3082,9 +3128,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServicesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServicesList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServicesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServicesList#Multiple @@ -3104,9 +3150,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone#Multiple @@ -3132,24 +3178,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneProperties#Multiple - - - - - - @@ -3166,15 +3206,9 @@ DisplayName - - DnsServerIP - DnsService - - Domain - ProvisioningState @@ -3190,9 +3224,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZonesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZonesList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZonesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZonesList#Multiple @@ -3212,9 +3246,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGateway + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGateway - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGateway + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGateway#Multiple @@ -3240,9 +3274,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayList#Multiple @@ -3262,9 +3296,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayProperties#Multiple @@ -3290,9 +3324,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkList + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkList#Multiple + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring#Multiple @@ -3318,9 +3374,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringList#Multiple @@ -3340,9 +3396,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringProperties#Multiple @@ -3398,9 +3454,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIP + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIP + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP#Multiple @@ -3426,9 +3482,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPProperties#Multiple @@ -3466,9 +3522,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPsList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPsList#Multiple @@ -3488,9 +3544,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment#Multiple @@ -3516,9 +3572,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVif + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVif - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVif + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVif#Multiple @@ -3538,9 +3594,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentProperties#Multiple @@ -3584,9 +3640,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentsList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentsList#Multiple @@ -3606,15 +3662,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnet + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnet - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnet + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnet#Multiple - - - @@ -3622,9 +3675,6 @@ - - DhcpRange - GatewayAddress @@ -3634,9 +3684,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachine + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachine - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachine + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachine#Multiple @@ -3662,9 +3712,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineProperties#Multiple @@ -3690,9 +3740,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachinesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachinesList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachinesList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachinesList#Multiple @@ -3712,9 +3762,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup#Multiple @@ -3740,18 +3790,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupProperties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupProperties#Multiple - - - @@ -3768,9 +3815,6 @@ DisplayName - - Member - ProvisioningState @@ -3786,9 +3830,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupsList - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupsList + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupsList#Multiple @@ -3807,39 +3851,5 @@ - - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponse - - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponse - - - - - - - - - - - - - - - - - - Code - - - Message - - - Target - - - - - - \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/Az.VMware.psd1 b/src/VMware/VMware.Autorest/Az.VMware.psd1 index b55cc385393c..424c2ddd1dc2 100644 --- a/src/VMware/VMware.Autorest/Az.VMware.psd1 +++ b/src/VMware/VMware.Autorest/Az.VMware.psd1 @@ -1,159 +1,23 @@ -# -# Module manifest for module 'Az.VMware' -# -# Generated by: Microsoft Corporation -# -# Generated on: 10/10/2022 -# - @{ - -# Script module or binary module file associated with this manifest. -RootModule = './Az.VMware.psm1' - -# Version number of this module. -ModuleVersion = '0.5.0' - -# Supported PSEditions -CompatiblePSEditions = 'Core', 'Desktop' - -# ID used to uniquely identify this module -GUID = '78d2fac8-ec90-47ad-b8aa-a27106b158f5' - -# Author of this module -Author = 'Microsoft Corporation' - -# Company or vendor of this module -CompanyName = 'Microsoft Corporation' - -# Copyright statement for this module -Copyright = 'Microsoft Corporation. All rights reserved.' - -# Description of the functionality provided by this module -Description = 'Microsoft Azure PowerShell: VMware cmdlets' - -# Minimum version of the PowerShell engine required by this module -PowerShellVersion = '5.1' - -# Name of the PowerShell host required by this module -# PowerShellHostName = '' - -# Minimum version of the PowerShell host required by this module -# PowerShellHostVersion = '' - -# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -DotNetFrameworkVersion = '4.7.2' - -# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. -# ClrVersion = '' - -# Processor architecture (None, X86, Amd64) required by this module -# ProcessorArchitecture = '' - -# Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.2'; }) - -# Assemblies that must be loaded prior to importing this module -RequiredAssemblies = './bin/Az.VMware.private.dll' - -# Script files (.ps1) that are run in the caller's environment prior to importing this module. -# ScriptsToProcess = @() - -# Type files (.ps1xml) to be loaded when importing this module -# TypesToProcess = @() - -# Format files (.ps1xml) to be loaded when importing this module -FormatsToProcess = './Az.VMware.format.ps1xml' - -# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess -# NestedModules = @() - -# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization', - 'Get-AzVMwareCloudLink', 'Get-AzVMwareCluster', - 'Get-AzVMwareDatastore', 'Get-AzVMwareGlobalReachConnection', - 'Get-AzVMwarePlacementPolicy', 'Get-AzVMwarePrivateCloud', - 'Get-AzVMwarePrivateCloudAdminCredential', - 'Get-AzVMwareVirtualMachine', 'New-AzVMwareAddon', - 'New-AzVMwareAddonSrmPropertiesObject', - 'New-AzVMwareAddonVrPropertiesObject', 'New-AzVMwareAuthorization', - 'New-AzVMwareCloudLink', 'New-AzVMwareCluster', - 'New-AzVMwareDatastore', 'New-AzVMwareGlobalReachConnection', - 'New-AzVMwarePlacementPolicy', 'New-AzVMwarePrivateCloud', - 'New-AzVMwarePrivateCloudNsxtPassword', - 'New-AzVMwarePrivateCloudVcenterPassword', - 'New-AzVMwarePSCredentialExecutionParameterObject', - 'New-AzVMwareScriptSecureStringExecutionParameterObject', - 'New-AzVMwareScriptStringExecutionParameterObject', - 'New-AzVMwareVmHostPlacementPolicyPropertiesObject', - 'New-AzVMwareVMPlacementPolicyPropertiesObject', - 'Remove-AzVMwareAddon', 'Remove-AzVMwareAuthorization', - 'Remove-AzVMwareCloudLink', 'Remove-AzVMwareCluster', - 'Remove-AzVMwareDatastore', 'Remove-AzVMwareGlobalReachConnection', - 'Remove-AzVMwarePlacementPolicy', 'Remove-AzVMwarePrivateCloud', - 'Test-AzVMwareLocationQuotaAvailability', - 'Test-AzVMwareLocationTrialAvailability', 'Update-AzVMwareCluster', - 'Update-AzVMwarePlacementPolicy', 'Update-AzVMwarePrivateCloud' - -# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. -CmdletsToExport = @() - -# Variables to export from this module -# VariablesToExport = @() - -# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. -AliasesToExport = '*' - -# DSC resources to export from this module -# DscResourcesToExport = @() - -# List of all modules packaged with this module -# ModuleList = @() - -# List of all files packaged with this module -# FileList = @() - -# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. -PrivateData = @{ - + GUID = '6ced3ed2-fb86-4a72-aca7-369161b12fea' + RootModule = './Az.VMware.psm1' + ModuleVersion = '0.4.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: VMware cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.VMware.private.dll' + FormatsToProcess = './Az.VMware.format.ps1xml' + FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization', 'Get-AzVMwareCloudLink', 'Get-AzVMwareCluster', 'Get-AzVMwareClusterZone', 'Get-AzVMwareDatastore', 'Get-AzVMwareGlobalReachConnection', 'Get-AzVMwarePlacementPolicy', 'Get-AzVMwarePrivateCloud', 'Get-AzVMwarePrivateCloudAdminCredential', 'Get-AzVMwareVirtualMachine', 'New-AzVMwareAddon', 'New-AzVMwareAddonSrmPropertiesObject', 'New-AzVMwareAddonVrPropertiesObject', 'New-AzVMwareAuthorization', 'New-AzVMwareCloudLink', 'New-AzVMwareCluster', 'New-AzVMwareDatastore', 'New-AzVMwareGlobalReachConnection', 'New-AzVMwareIdentitySourceObject', 'New-AzVMwarePlacementPolicy', 'New-AzVMwarePrivateCloud', 'New-AzVMwarePrivateCloudNsxtPassword', 'New-AzVMwarePrivateCloudVcenterPassword', 'New-AzVMwarePSCredentialExecutionParameterObject', 'New-AzVMwareScriptSecureStringExecutionParameterObject', 'New-AzVMwareScriptStringExecutionParameterObject', 'New-AzVMwareVmHostPlacementPolicyPropertiesObject', 'New-AzVMwareVMPlacementPolicyPropertiesObject', 'Remove-AzVMwareAddon', 'Remove-AzVMwareAuthorization', 'Remove-AzVMwareCloudLink', 'Remove-AzVMwareCluster', 'Remove-AzVMwareDatastore', 'Remove-AzVMwareGlobalReachConnection', 'Remove-AzVMwarePlacementPolicy', 'Remove-AzVMwarePrivateCloud', 'Test-AzVMwareLocationQuotaAvailability', 'Test-AzVMwareLocationTrialAvailability', 'Update-AzVMwareAuthorization', 'Update-AzVMwareCloudLink', 'Update-AzVMwareCluster', 'Update-AzVMwareDatastore', 'Update-AzVMwareGlobalReachConnection', 'Update-AzVMwarePlacementPolicy', 'Update-AzVMwarePrivateCloud' + PrivateData = @{ PSData = @{ - - # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'Azure','ResourceManager','ARM','PSModule','VMware' - - # A URL to the license for this module. - LicenseUri = 'https://aka.ms/azps-license' - - # A URL to the main website for this project. - ProjectUri = 'https://github.com/Azure/azure-powershell' - - # A URL to an icon representing this module. - # IconUri = '' - - # ReleaseNotes of this module - ReleaseNotes = '* Added cmdlet: - - ''Get-AzVMwareDatastore'' - - ''New-AzVMwareDatastore'' - - ''Remove-AzVMwareDatastore''' - - # Prerelease string of this module - # Prerelease = '' - - # Flag to indicate whether the module requires explicit user acceptance for install/update/save - # RequireLicenseAcceptance = $false - - # External dependent modules of this module - # ExternalModuleDependencies = @() - - } # End of PSData hashtable - - } # End of PrivateData hashtable - -# HelpInfo URI of this module -# HelpInfoURI = '' - -# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. -# DefaultCommandPrefix = '' - + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'VMware' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } } - diff --git a/src/VMware/VMware.Autorest/README.md b/src/VMware/VMware.Autorest/README.md index 914b3b7ab86b..0e36aed7acab 100644 --- a/src/VMware/VMware.Autorest/README.md +++ b/src/VMware/VMware.Autorest/README.md @@ -47,19 +47,17 @@ In this directory, run AutoRest: > see https://aka.ms/autorest ``` yaml -branch: 2e665b044670074d91e8a9e6d04f23fbe3c8a06e +commit: 0baf811c3c76c87b3c127d098519bd97141222dd require: - - $(this-folder)/../readme.azure.noprofile.md + - $(this-folder)/../../readme.azure.noprofile.md input-file: - - $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2021-12-01/vmware.json + - $(repo)/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-03-01/vmware.json module-version: 0.4.0 title: VMware subject-prefix: $(service-name) -identity-correction-for-post: true -resourcegroup-append: true -nested-object-to-string: true +support-json-input: false directive: - from: swagger-document @@ -83,7 +81,7 @@ directive: "format": "password" } - where: - variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$ + variant: ^(Create|Update)(?!.*?Expanded) remove: true - where: variant: ^Restrict$|^RestrictViaIdentity$ @@ -121,12 +119,47 @@ directive: remove: true - where: verb: Test - subject: ^LocationTrialAvailability$|^LocationQuotaAvailability$ + subject: ^LocationQuotaAvailability$ variant: ^CheckViaIdentity$ remove: true + # Remove v4 variant + - where: + verb: Test + subject: ^LocationTrialAvailability$ + variant: ^Check$|CheckViaIdentity + remove: true + - where: + verb: New + subject: PrivateCloud + variant: CreateViaIdentityExpanded + remove: true + # custom set SKU Name optional + # - where: + # verb: Test + # subject: ^LocationTrialAvailability$ + # hide: true + # Remove the list variant as the workloadNetwork only have one enum value + - where: + verb: Get + subject: WorkloadNetwork + # variant: List + hide: true + # Hide parent object variant to fix 'multiple types define RestrictMovement [string, IVirtualMachineRestrictMovement]' + - where: + verb: Lock + subject: VirtualMachineMovement + variant: ^RestrictViaIdentityCluster$|^RestrictViaIdentityPrivateCloud$ + remove: true + # Hide HcxEnterpriseSite, ScriptExecution, Addon update + - where: + verb: Update + subject: HcxEnterpriseSite|ScriptExecution|Addon + remove: true - no-inline: - AddonProperties - PlacementPolicyProperties + - model-cmdlet: + - model-name: IdentitySource # Re-name and custom it # - model-cmdlet: # - VMPlacementPolicyProperties diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/locations.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/locations.json index d414ab3499d8..41e2799f344c 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/locations.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/locations.json @@ -1,6 +1,6 @@ { "resourceType": "locations", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, @@ -37,39 +37,6 @@ ] } ] - }, - { - "name": "Test-AzVMwareLocationTrialAvailability", - "description": "Return trial status for subscription by region", - "path": "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability", - "help": { - "learnMore": { - "url": "https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability" - }, - "parameterSets": [ - { - "parameters": [ - "-Location ", - "[-SubscriptionId ]" - ] - } - ] - }, - "examples": [ - { - "description": "Return trial status for subscription by region", - "parameters": [ - { - "name": "-Location", - "value": "[Path.location]" - }, - { - "name": "-SubscriptionId", - "value": "[Path.subscriptionId]" - } - ] - } - ] } ] } diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-authorizations.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-authorizations.json index 1a061f015fbc..94d8600cc81d 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-authorizations.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-authorizations.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/authorizations", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-cloudLinks.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-cloudLinks.json index 35c1e37ff514..673a13f4486b 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-cloudLinks.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-cloudLinks.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/cloudLinks", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-datastores.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-datastores.json index 91019ac378be..686be6375cd3 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-datastores.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-datastores.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/clusters/datastores", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-placementPolicies.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-placementPolicies.json index 332352b8b3da..69cb075e68e5 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-placementPolicies.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-placementPolicies.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/clusters/placementPolicies", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-virtualMachines.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-virtualMachines.json index b6e0a808dcbc..93858c0449a0 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-virtualMachines.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters-virtualMachines.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/clusters/virtualMachines", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters.json index a6b0f6811d8b..aae124e85202 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-clusters.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/clusters", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-globalReachConnections.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-globalReachConnections.json index f1cf0d4d4a16..0e3859c18c26 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-globalReachConnections.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds-globalReachConnections.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds/globalReachConnections", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds.json b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds.json index f3ad98a44504..90a4844a598a 100644 --- a/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds.json +++ b/src/VMware/VMware.Autorest/UX/Microsoft.AVS/privateClouds.json @@ -1,6 +1,6 @@ { "resourceType": "privateClouds", - "apiVersion": "2021-12-01", + "apiVersion": "2023-03-01", "learnMore": { "url": "https://learn.microsoft.com/powershell/module/az.vmware" }, diff --git a/src/VMware/VMware.Autorest/build-module.ps1 b/src/VMware/VMware.Autorest/build-module.ps1 index d2fcb2391802..bb2f2aed8745 100644 --- a/src/VMware/VMware.Autorest/build-module.ps1 +++ b/src/VMware/VMware.Autorest/build-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]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs) +param([switch]$NotIsolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs, [switch]$UX) $ErrorActionPreference = 'Stop' if($PSEdition -ne 'Core') { Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' } -if(-not $Isolated -and -not $Debugger) { +if(-not $NotIsolated -and -not $Debugger) { Write-Host -ForegroundColor Green 'Creating isolated process...' $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 if($LastExitCode -ne 0) { # Build failed. Don't attempt to run the module. @@ -45,6 +45,14 @@ if(-not $Isolated -and -not $Debugger) { } } + if($UX) { + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') + if($LastExitCode -ne 0) { + # UX generation failed. Don't attempt to run the module. + return + } + } + if($Pack) { . (Join-Path $PSScriptRoot 'pack-module.ps1') if($LastExitCode -ne 0) { @@ -122,7 +130,11 @@ $examplesFolder = Join-Path $PSScriptRoot 'examples' $null = New-Item -ItemType Directory -Force -Path $examplesFolder Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' -$modelCmdlets = @() +$modelCmdlets = @(@{modelName="IdentitySource"; cmdletName=""}) +$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets' +if (Test-Path $modelCmdletFolder) { + $null = Remove-Item -Force -Recurse -Path $modelCmdletFolder +} if ($modelCmdlets.Count -gt 0) { . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') CreateModelCmdlet($modelCmdlets) @@ -139,7 +151,8 @@ if($NoDocs) { $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue } $null = New-Item -ItemType Directory -Force -Path $docsFolder - Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo } Write-Host -ForegroundColor Green 'Creating format.ps1xml...' @@ -158,4 +171,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol Write-Host -ForegroundColor Green 'Creating example stubs...' Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder +if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')) +{ + Write-Host -ForegroundColor Green 'Creating ux metadata...' + . (Join-Path $PSScriptRoot 'generate-portal-ux.ps1') +} + Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/src/VMware/VMware.Autorest/check-dependencies.ps1 b/src/VMware/VMware.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/src/VMware/VMware.Autorest/check-dependencies.ps1 +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/create-model-cmdlets.ps1 b/src/VMware/VMware.Autorest/create-model-cmdlets.ps1 index a029cb0ba43a..c80bb35ae5dd 100644 --- a/src/VMware/VMware.Autorest/create-model-cmdlets.ps1 +++ b/src/VMware/VMware.Autorest/create-model-cmdlets.ps1 @@ -15,7 +15,7 @@ function CreateModelCmdlet { - param([string[]]$Models) + param([Hashtable[]]$Models) if ($Models.Count -eq 0) { @@ -23,10 +23,13 @@ function CreateModelCmdlet { } $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models' - $ModuleName = 'VMware' $OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets' $null = New-Item -ItemType Directory -Force -Path $OutputDir - + if (''.length -gt 0) { + $ModuleName = '' + } else { + $ModuleName = 'Az.VMware' + } $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs $Content = '' $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) @@ -35,15 +38,34 @@ function CreateModelCmdlet { $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) $Nodes = $Tree.ChildNodes().ChildNodes() + $classConstantMember = @{} foreach ($Model in $Models) { - $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + $ModelName = $Model.modelName + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$ModelName") } + $ClassNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'class') -and ($_.Identifier.value -eq "$ModelName") } + $classConstantMember = @() + foreach ($class in $ClassNode) { + foreach ($member in $class.Members) { + $isConstant = $false + foreach ($attr in $member.AttributeLists) { + $memberName = $attr.Attributes.Name.ToString() + if ($memberName.EndsWith('.Constant')) { + $isConstant = $true + break + } + } + if (($member.Modifiers.ToString() -eq 'public') -and $isConstant) { + $classConstantMember += $member.Identifier.Value + } + } + } if ($InterfaceNode.count -eq 0) { continue } # through a queue, we iterate all the parent models. $Queue = @($InterfaceNode) - $visited = @("I$Model") + $visited = @("I$ModelName") $AllInterfaceNodes = @() while ($Queue.count -ne 0) { @@ -61,13 +83,13 @@ function CreateModelCmdlet { } $Namespace = $InterfaceNode.Parent.Name - $ObjectType = $Model + $ObjectType = $ModelName $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" # remove duplicated module name - if ($ObjectType.StartsWith($ModuleName)) { + if ($ObjectType.StartsWith('VMware')) { $ModulePrefix = '' } else { - $ModulePrefix = $ModuleName + $ModulePrefix = 'VMware' } $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir @@ -77,10 +99,15 @@ function CreateModelCmdlet { { foreach ($Member in $Node.Members) { + if ($classConstantMember.Contains($Member.Identifier.Value)) { + # skip constant member + continue + } $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments $Required = $false $Description = "" $Readonly = $False + $mutability = @{Read = $true; Create = $true; Update = $true} foreach ($Argument in $Arguments) { if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") @@ -95,6 +122,18 @@ function CreateModelCmdlet { { $Readonly = $Argument.Expression.Token.Value } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Read") + { + $mutability.Read = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Create") + { + $mutability.Create = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Update") + { + $mutability.Update = $Argument.Expression.Token.Value + } } if ($Readonly) { @@ -102,8 +141,18 @@ function CreateModelCmdlet { } $Identifier = $Member.Identifier.Value $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + if ($Type.StartsWith("System.Collections.Generic.List")) + { + # if the type is a list, we need to convert it to array + $matched = $Type -match '\<(?.+)\>$' + if ($matched) + { + $Type = $matches.Name + '[]'; + } + } $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] - if ($Required) + if ($Required -and $mutability.Create -and $mutability.Update) { $ParameterDefinePropertyList.Add("Mandatory") } @@ -113,11 +162,9 @@ function CreateModelCmdlet { } $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) # check whether completer is needed - $completer = ''; - if($Type.Split('.').Split('.')[-2] -eq 'Support') { - # If Type is an array, need to strip [] - $strippedType = $Type.Replace('[]', '') - $completer += "`n [ArgumentCompleter([${strippedType}])]" + $completer = ''; + if(IsEnumType($Member)){ + $completer += GetCompleter($Member) } $ParameterDefineScript = " [Parameter($ParameterDefineProperty)]${completer} @@ -133,6 +180,12 @@ function CreateModelCmdlet { $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + $cmdletName = "New-Az${ModulePrefix}${ObjectType}Object" + if ('' -ne $Model.cmdletName) { + $cmdletName = $Model.cmdletName + } + $OutputPath = Join-Path -ChildPath "${cmdletName}.ps1" -Path $OutputDir + $cmdletNameInLowerCase = $cmdletName.ToLower() $Script = " # ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -158,9 +211,9 @@ Create an in-memory object for ${ObjectType}. .Outputs ${ObjectTypeWithNamespace} .Link -https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +https://learn.microsoft.com/powershell/module/${ModuleName}/${cmdletNameInLowerCase} #> -function New-Az${ModulePrefix}${ObjectType}Object { +function ${cmdletName} { [OutputType('${ObjectTypeWithNamespace}')] [CmdletBinding(PositionalBinding=`$false)] Param( @@ -177,3 +230,33 @@ ${ParameterAssignScript} Set-Content -Path $OutputPath -Value $Script } } + +function IsEnumType { + param ( + [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property + ) + $isEnum = $false + foreach ($attr in $property.AttributeLists) { + $attributeName = $attr.Attributes.Name.ToString() + if ($attributeName.Contains('ArgumentCompleter')) { + $isEnum = $true + break + } + } + return $isEnum; +} + +function GetCompleter { + param ( + [Microsoft.CodeAnalysis.CSharp.Syntax.PropertyDeclarationSyntax]$property + ) + foreach ($attr in $property.AttributeLists) { + $attributeName = $attr.Attributes.Name.ToString() + if ($attributeName.Contains('ArgumentCompleter')) { + $attributeName = $attributeName.Split("::")[-1] + $possibleValues = [System.String]::Join(", ", $attr.Attributes.ArgumentList.Arguments) + $completer += "`n [${attributeName}(${possibleValues})]" + return $completer + } + } +} diff --git a/src/VMware/VMware.Autorest/custom/Get-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/custom/Get-AzVMwareAddon.ps1 index aa399faab1cb..c1ca79809123 100644 --- a/src/VMware/VMware.Autorest/custom/Get-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/custom/Get-AzVMwareAddon.ps1 @@ -36,7 +36,7 @@ vr Microsoft.AVS/privateClouds/addons azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES @@ -72,7 +72,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon #> function Get-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareAddon.ps1 index 0280f00734b0..99e7da339f8c 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareAddon.ps1 @@ -28,7 +28,7 @@ Name Type ResourceGroupName vr Microsoft.AVS/privateClouds/addons azps_test_group .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES @@ -40,7 +40,7 @@ PROPERTY : The properties of an addon resource https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon #> function New-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -65,7 +65,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties] # The properties of an addon resource # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonSrmPropertiesObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonSrmPropertiesObject.ps1 index 920e7d991e7c..eb4894260f8f 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonSrmPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonSrmPropertiesObject.ps1 @@ -1,4 +1,3 @@ - # ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation @@ -20,12 +19,12 @@ Create a in-memory object for AddonSrmProperties .Outputs - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject #> function New-AzVMwareAddonSrmPropertiesObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -35,7 +34,7 @@ ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties]::New() $Object.LicenseKey = $LicenseKey $Object.AddonType = "SRM" diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonVrPropertiesObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonVrPropertiesObject.ps1 index 0a49c4469ebd..c2e93fd59606 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonVrPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareAddonVrPropertiesObject.ps1 @@ -1,4 +1,3 @@ - # ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation @@ -20,12 +19,12 @@ Create a in-memory object for AddonVrProperties .Outputs - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject #> function New-AzVMwareAddonVrPropertiesObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -35,7 +34,7 @@ ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties]::New() $Object.VrsCount = $VrsCount $Object.AddonType = "VR" diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwarePSCredentialExecutionParameterObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwarePSCredentialExecutionParameterObject.ps1 index 8d130e6c572b..985a99d1a5d3 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwarePSCredentialExecutionParameterObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwarePSCredentialExecutionParameterObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for PSCredentialExecutionParameter .Outputs - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject #> function New-AzVMwarePSCredentialExecutionParameterObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -41,7 +41,7 @@ ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter]::New() $Object.Password = $Password $Object.Username = $Username diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwarePrivateCloud.ps1 index 56423223234b..e21edc216e4a 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwarePrivateCloud.ps1 @@ -16,18 +16,20 @@ <# .Synopsis -Create or update a private cloud +Create a private cloud .Description -Create or update a private cloud +Create a private cloud .Example -PS C:\> New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast +New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast Location Name Type ResourceGroupName -------- ---- ---- ----------------- australiaeast azps_test_cloud Microsoft.AVS/privateClouds azps_test_group +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud .Notes COMPLEX PARAMETER PROPERTIES @@ -42,13 +44,13 @@ IDENTITYSOURCE : vCenter Single Sign On Identity Sources [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. [PrimaryServer ]: Primary server URL [SecondaryServer ]: Secondary server URL - [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud #> function New-AzVMwarePrivateCloud { - [OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -86,24 +88,101 @@ function New-AzVMwarePrivateCloud { ${Sku}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.Int32] + # The secondary availability zone for the private cloud + ${AvailabilitySecondaryZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The availability strategy for the private cloud + ${AvailabilityStrategy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.Int32] + # The primary availability zone for the private cloud + ${AvailabilityZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Status of customer managed encryption key + ${EncryptionStatus}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] + # vCenter Single Sign On Identity Sources + # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. + ${IdentitySource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The type of identity used for the private cloud. + # The type 'SystemAssigned' refers to an implicitly created identity. + # The type 'None' will remove any identities from the Private Cloud. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the key. + ${KeyVaultPropertyKeyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The URL of the vault. + ${KeyVaultPropertyKeyVaultUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The version of the key. + ${KeyVaultPropertyKeyVersion}, + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] # Resource location ${Location}, + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # The hosts + ${ManagementClusterHost}, + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.Int32] # The cluster size ${ManagementClusterSize}, - + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -112,7 +191,7 @@ function New-AzVMwarePrivateCloud { [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -133,7 +212,8 @@ function New-AzVMwarePrivateCloud { [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 index a217619009cc..bbbf3119f132 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for ScriptSecureStringExecutionParameter .Outputs - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptSecureStringExecutionParameterObject #> function New-AzVMwareScriptSecureStringExecutionParameterObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -38,7 +38,7 @@ ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter]::New() $Object.SecureValue = $SecureValue $Object.Name = $Name diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptStringExecutionParameterObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptStringExecutionParameterObject.ps1 index 767fb674bf93..e927d67f46dc 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptStringExecutionParameterObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareScriptStringExecutionParameterObject.ps1 @@ -20,12 +20,12 @@ Create a in-memory object for ScriptStringExecutionParameter .Outputs - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptStringExecutionParameterObject #> function New-AzVMwareScriptStringExecutionParameterObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter')] [CmdletBinding(PositionalBinding=$false)] Param( @@ -38,7 +38,7 @@ ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter]::New() $Object.Value = $Value $Object.Name = $Name diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 index f180489e9e7a..c911281b689c 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 @@ -21,18 +21,18 @@ Create an in-memory object for VMPlacementPolicyProperties. Create an in-memory object for VMPlacementPolicyProperties. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVMPlacementPolicyPropertiesObject #> function New-AzVMwareVMPlacementPolicyPropertiesObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties')] [CmdletBinding(PositionalBinding=$false)] Param( - [Parameter(Mandatory, HelpMessage="placement policy affinity type.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType] + [Parameter(Mandatory, HelpMessage="placement policy affinity type.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + [string] $AffinityType, [Parameter(Mandatory, HelpMessage="Virtual machine members list.")] [string[]] @@ -41,17 +41,17 @@ function New-AzVMwareVMPlacementPolicyPropertiesObject { [string] $DisplayName, [Parameter(HelpMessage="Whether the placement policy is enabled or disabled.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [string] $State, [Parameter(Mandatory, HelpMessage="placement policy type.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] + [string] $Type ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties]::New() if ($PSBoundParameters.ContainsKey('AffinityType')) { $Object.AffinityType = $AffinityType diff --git a/src/VMware/VMware.Autorest/custom/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 b/src/VMware/VMware.Autorest/custom/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 index a30c350a7866..160e62c5562e 100644 --- a/src/VMware/VMware.Autorest/custom/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/custom/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 @@ -21,18 +21,18 @@ Create an in-memory object for VmHostPlacementPolicyProperties. Create an in-memory object for VmHostPlacementPolicyProperties. .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VmHostPlacementPolicyProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20230301.VmHostPlacementPolicyProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVmHostPlacementPolicyPropertiesObject #> function New-AzVMwareVmHostPlacementPolicyPropertiesObject { - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VmHostPlacementPolicyProperties')] + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VmHostPlacementPolicyProperties')] [CmdletBinding(PositionalBinding=$false)] Param( [Parameter(Mandatory, HelpMessage="placement policy affinity type.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + [string] $AffinityType, [Parameter(Mandatory, HelpMessage="Host members list.")] [string[]] @@ -44,17 +44,17 @@ function New-AzVMwareVmHostPlacementPolicyPropertiesObject { [string] $DisplayName, [Parameter(HelpMessage="Whether the placement policy is enabled or disabled.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [string] $State, [Parameter(Mandatory, HelpMessage="placement policy type.")] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] + [string] $Type ) process { - $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VmHostPlacementPolicyProperties]::New() + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VmHostPlacementPolicyProperties]::New() if ($PSBoundParameters.ContainsKey('AffinityType')) { $Object.AffinityType = $AffinityType diff --git a/src/VMware/VMware.Autorest/custom/autogen-model-cmdlets/New-AzVMwareIdentitySourceObject.ps1 b/src/VMware/VMware.Autorest/custom/autogen-model-cmdlets/New-AzVMwareIdentitySourceObject.ps1 new file mode 100644 index 000000000000..cb2806a18f66 --- /dev/null +++ b/src/VMware/VMware.Autorest/custom/autogen-model-cmdlets/New-AzVMwareIdentitySourceObject.ps1 @@ -0,0 +1,102 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for IdentitySource. +.Description +Create an in-memory object for IdentitySource. + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource +.Link +https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject +#> +function New-AzVMwareIdentitySourceObject { + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource')] + [CmdletBinding(PositionalBinding=$false)] + Param( + + [Parameter(HelpMessage="The domain's NetBIOS name.")] + [string] + $Alias, + [Parameter(HelpMessage="The base distinguished name for groups.")] + [string] + $BaseGroupDn, + [Parameter(HelpMessage="The base distinguished name for users.")] + [string] + $BaseUserDn, + [Parameter(HelpMessage="The domain's dns name.")] + [string] + $Domain, + [Parameter(HelpMessage="The name of the identity source.")] + [string] + $Name, + [Parameter(HelpMessage="The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups.")] + [string] + $Password, + [Parameter(HelpMessage="Primary server URL.")] + [string] + $PrimaryServer, + [Parameter(HelpMessage="Secondary server URL.")] + [string] + $SecondaryServer, + [Parameter(HelpMessage="Protect LDAP communication using SSL certificate (LDAPS).")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [string] + $Ssl, + [Parameter(HelpMessage="The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group.")] + [string] + $Username + ) + + process { + $Object = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource]::New() + + if ($PSBoundParameters.ContainsKey('Alias')) { + $Object.Alias = $Alias + } + if ($PSBoundParameters.ContainsKey('BaseGroupDn')) { + $Object.BaseGroupDn = $BaseGroupDn + } + if ($PSBoundParameters.ContainsKey('BaseUserDn')) { + $Object.BaseUserDn = $BaseUserDn + } + if ($PSBoundParameters.ContainsKey('Domain')) { + $Object.Domain = $Domain + } + if ($PSBoundParameters.ContainsKey('Name')) { + $Object.Name = $Name + } + if ($PSBoundParameters.ContainsKey('Password')) { + $Object.Password = $Password + } + if ($PSBoundParameters.ContainsKey('PrimaryServer')) { + $Object.PrimaryServer = $PrimaryServer + } + if ($PSBoundParameters.ContainsKey('SecondaryServer')) { + $Object.SecondaryServer = $SecondaryServer + } + if ($PSBoundParameters.ContainsKey('Ssl')) { + $Object.Ssl = $Ssl + } + if ($PSBoundParameters.ContainsKey('Username')) { + $Object.Username = $Username + } + return $Object + } +} + diff --git a/src/VMware/VMware.Autorest/examples/Get-AzVMwareClusterZone.md b/src/VMware/VMware.Autorest/examples/Get-AzVMwareClusterZone.md new file mode 100644 index 000000000000..26326bd8d9f9 --- /dev/null +++ b/src/VMware/VMware.Autorest/examples/Get-AzVMwareClusterZone.md @@ -0,0 +1,11 @@ +### Example 1: List hosts by zone in a cluster +```powershell +Get-AzVMwareClusterZone -PrivateCloudName SDDC2 -ResourceGroupName TestSddc-rg -ClusterName Cluster-1 +``` +```output +Host Zone +---- ---- +{esx09-r09.p01.canadacentral.avs.azure.com, esx02-r06.p01.canadacentral.avs.azure.com, esx20-r08.p01.canadacentral.avs.azure.com} 3 +``` + +List hosts by zone in a cluster \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonSrmPropertiesObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonSrmPropertiesObject.md index 08eaeafe1cba..1b7b51851942 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonSrmPropertiesObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonSrmPropertiesObject.md @@ -3,9 +3,9 @@ New-AzVMwareAddonSrmPropertiesObject -LicenseKey "YourLicenseKeyValue" ``` ```output -AddonType ProvisioningState LicenseKey ---------- ----------------- ---------- -SRM YourLicenseKeyValue +AddonType LicenseKey ProvisioningState +--------- ---------- ----------------- +SRM YourLicenseKeyValue ``` Create a local SRM object for the Addon Property parameter \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonVrPropertiesObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonVrPropertiesObject.md index ad2fa1006f83..8873bbb02979 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonVrPropertiesObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareAddonVrPropertiesObject.md @@ -5,7 +5,7 @@ New-AzVMwareAddonVrPropertiesObject -VrsCount 2 ```output AddonType ProvisioningState VrsCount --------- ----------------- -------- -VR 2 +VR 2 ``` Create a local VR object for the Addon Property parameter \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareIdentitySourceObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareIdentitySourceObject.md new file mode 100644 index 000000000000..70068547f284 --- /dev/null +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareIdentitySourceObject.md @@ -0,0 +1,18 @@ +### Example 1: Create an in-memory object for IdentitySource +```powershell +New-AzVMwareIdentitySourceObject -Alias test +``` +```output +Alias : test +BaseGroupDn : +BaseUserDn : +Domain : +Name : +Password : +PrimaryServer : +SecondaryServer : +Ssl : +Username : +``` + +Create an in-memory object for IdentitySource \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwarePSCredentialExecutionParameterObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwarePSCredentialExecutionParameterObject.md index b12c0637b0c2..7414ca16f031 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwarePSCredentialExecutionParameterObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwarePSCredentialExecutionParameterObject.md @@ -3,9 +3,9 @@ New-AzVMwarePSCredentialExecutionParameterObject -Name azps_test_credentialvalue -Password "passwordValue" -Username "usernameValue" ``` ```output -Name Type Password Username ----- ---- -------- -------- -azps_test_credentialvalue Credential passwordValue usernameValue +Name Password Type Username +---- -------- ---- -------- +azps_test_credentialvalue passwordValue Credential usernameValue ``` Create a local PS Credential Execution object \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptSecureStringExecutionParameterObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptSecureStringExecutionParameterObject.md index fe4f7ae995eb..92c3ce00ad68 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptSecureStringExecutionParameterObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptSecureStringExecutionParameterObject.md @@ -3,9 +3,9 @@ New-AzVMwareScriptSecureStringExecutionParameterObject -Name azps_test_securevalue -SecureValue "passwordValue" ``` ```output -Name Type SecureValue ----- ---- ----------- -azps_test_securevalue SecureValue passwordValue +Name SecureValue Type +---- ----------- ---- +azps_test_securevalue passwordValue SecureValue ``` Create a local Script Secure String Execution object \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptStringExecutionParameterObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptStringExecutionParameterObject.md index 74a9c450d404..2a4af6b0f6d6 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptStringExecutionParameterObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareScriptStringExecutionParameterObject.md @@ -1,11 +1,11 @@ ### Example 1: Create a local Script String Execution object ```powershell -New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_stringvalue -Value "stringValue" +New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_value -Value "passwordValue" ``` ```output -Name Type Value ----- ---- ----- -azps_test_stringvalue Value stringValue +Name Value +---- ----------- +azps_test_value passwordValue ``` Create a local Script String Execution object \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareVMPlacementPolicyPropertiesObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareVMPlacementPolicyPropertiesObject.md index 5171ebeb2db7..bc8b5c2e2d77 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwareVMPlacementPolicyPropertiesObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareVMPlacementPolicyPropertiesObject.md @@ -1,11 +1,14 @@ ### Example 1: Create an in-memory object for VMPlacementPolicyProperties. ```powershell -New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"abc"="123"} + New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} ``` ```output -DisplayName ProvisioningState State AffinityType VMMember ------------ ----------------- ----- ------------ -------- - Affinity {System.Collections.Hashtable} +AffinityType : Affinity +DisplayName : +ProvisioningState : +State : +Type : VmVm +VMMember : {System.Collections.Hashtable} ``` Create an in-memory object for VMPlacementPolicyProperties. \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md b/src/VMware/VMware.Autorest/examples/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md index f5e1376a02e5..db24ec7cc767 100644 --- a/src/VMware/VMware.Autorest/examples/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md +++ b/src/VMware/VMware.Autorest/examples/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md @@ -1,11 +1,17 @@ ### Example 1: Create an in-memory object for VmHostPlacementPolicyProperties. ```powershell -New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"abc"="123"} -Type 'VmHost' -VMMember @{"abc"="123"} +New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} ``` ```output -DisplayName ProvisioningState State AffinityType HostMember VMMember ------------ ----------------- ----- ------------ ---------- -------- - AntiAffinity {System.Collections.Hashtable} {System.Collections.Hashtable} +AffinityStrength : +AffinityType : AntiAffinity +AzureHybridBenefitType : +DisplayName : +HostMember : {System.Collections.Hashtable} +ProvisioningState : +State : +Type : VmHost +VMMember : {System.Collections.Hashtable} ``` Create an in-memory object for VmHostPlacementPolicyProperties. \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/Test-AzVMwareLocationTrialAvailability.md b/src/VMware/VMware.Autorest/examples/Test-AzVMwareLocationTrialAvailability.md index 4c47df926afe..fc2411cad79c 100644 --- a/src/VMware/VMware.Autorest/examples/Test-AzVMwareLocationTrialAvailability.md +++ b/src/VMware/VMware.Autorest/examples/Test-AzVMwareLocationTrialAvailability.md @@ -1,6 +1,6 @@ ### Example 1: Check trial availability ```powershell -Test-AzVMwareLocationTrialAvailability -Location westcentralus +Test-AzVMwareLocationTrialAvailability -Location westcentralus -Name av36 ``` ```output AvailableHost Status diff --git a/src/VMware/VMware.Autorest/examples/Update-AzVMwareAuthorization.md b/src/VMware/VMware.Autorest/examples/Update-AzVMwareAuthorization.md new file mode 100644 index 000000000000..e0eef44672a0 --- /dev/null +++ b/src/VMware/VMware.Autorest/examples/Update-AzVMwareAuthorization.md @@ -0,0 +1,16 @@ +### Example 1: Update an ExpressRoute Circuit Authorization in a private cloud +```powershell +Update-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` +```output +ExpressRouteAuthorizationId : ExpressRouteURI +ExpressRouteId : ExpressRouteId +Id : Id +Key : GUID +Name : azps_test_authorization +ProvisioningState : Succeeded +ResourceGroupName : azps_test_group +Type : Microsoft.AVS/privateClouds/authorizations +``` + +Update an ExpressRoute Circuit Authorization in a private cloud \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/Update-AzVMwareCloudLink.md b/src/VMware/VMware.Autorest/examples/Update-AzVMwareCloudLink.md new file mode 100644 index 000000000000..29f96552644f --- /dev/null +++ b/src/VMware/VMware.Autorest/examples/Update-AzVMwareCloudLink.md @@ -0,0 +1,11 @@ +### Example 1: Update a cloud link in a private cloud +```powershell +Update-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" +``` +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cloudlink Microsoft.AVS/privateClouds/cloudLinks azps_test_group +``` + +Update a cloud link in a private cloud \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/Update-AzVMwareDatastore.md b/src/VMware/VMware.Autorest/examples/Update-AzVMwareDatastore.md new file mode 100644 index 000000000000..25b291d27c7e --- /dev/null +++ b/src/VMware/VMware.Autorest/examples/Update-AzVMwareDatastore.md @@ -0,0 +1,11 @@ +### Example 1: Update a datastore in a private cloud cluster. +```powershell +Update-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" +``` +```output +Name Status ProvisioningState ResourceGroupName +---- ------ ----------------- ----------------- +azps_test_datastore Accessible Succeeded azps_test_group +``` + +Update a datastore in a private cloud cluster. \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/examples/Update-AzVMwareGlobalReachConnection.md b/src/VMware/VMware.Autorest/examples/Update-AzVMwareGlobalReachConnection.md new file mode 100644 index 000000000000..f73c0a0ebfeb --- /dev/null +++ b/src/VMware/VMware.Autorest/examples/Update-AzVMwareGlobalReachConnection.md @@ -0,0 +1,11 @@ +### Example 1: Update a global reach connection in a private cloud +```powershell +Update-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_grc Microsoft.AVS/privateClouds/globalReachConnections azps_test_group +``` + +Update a global reach connection in a private cloud \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/export-surface.ps1 b/src/VMware/VMware.Autorest/export-surface.ps1 index cd80ef70b1eb..41366811085b 100644 --- a/src/VMware/VMware.Autorest/export-surface.ps1 +++ b/src/VMware/VMware.Autorest/export-surface.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]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +param([switch]$NotIsolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat) $ErrorActionPreference = 'Stop' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareAddon.ps1 index 7bb1c827f3cd..b0085385f76c 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareAddon.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon #> function Get-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List', Mandatory)] @@ -160,7 +161,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -181,11 +182,15 @@ begin { Get = 'Az.VMware.custom\Get-AzVMwareAddon'; GetViaIdentity = 'Az.VMware.custom\Get-AzVMwareAddon'; } - if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareAuthorization.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareAuthorization.ps1 index c7c01cfdde63..cdba5ce0dc4b 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareAuthorization.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareAuthorization.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName a .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareauthorization #> function Get-AzVMwareAuthorization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('AuthorizationName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -160,7 +198,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -179,13 +217,18 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareAuthorization_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareAuthorization_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareAuthorization_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareAuthorization_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareCloudLink.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareCloudLink.ps1 index 32640ac05eae..f1acb86900fd 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareCloudLink.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareCloudLink.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareCloudLink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_ .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecloudlink #> function Get-AzVMwareCloudLink { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('CloudLinkName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -160,7 +198,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -179,13 +217,18 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareCloudLink_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareCloudLink_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareCloudLink_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareCloudLink_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareCluster.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareCluster.ps1 index 38e9cc425dfd..7b61d4de9f77 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareCluster.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareCluster.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -R .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecluster #> function Get-AzVMwareCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -160,7 +198,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -179,13 +217,18 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareCluster_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareCluster_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareCluster_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareCluster_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareClusterZone.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareClusterZone.ps1 new file mode 100644 index 000000000000..82cc7230792b --- /dev/null +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareClusterZone.ps1 @@ -0,0 +1,188 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List hosts by zone in a cluster +.Description +List hosts by zone in a cluster +.Example +Get-AzVMwareClusterZone -PrivateCloudName SDDC2 -ResourceGroupName TestSddc-rg -ClusterName Cluster-1 + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList +.Link +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareclusterzone +#> +function Get-AzVMwareClusterZone { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.VMware.private\Get-AzVMwareClusterZone_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareDatastore.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareDatastore.ps1 index c25ed7f3bda1..5b133d9c8a32 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareDatastore.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareDatastore.ps1 @@ -27,12 +27,40 @@ Get-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore - .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,14 +87,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwaredatastore #> function Get-AzVMwareDatastore { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -74,6 +132,8 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('DatastoreName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -110,12 +170,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -167,7 +242,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,13 +261,19 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareDatastore_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentity'; + GetViaIdentityCluster = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentityCluster'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareDatastore_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareGlobalReachConnection.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareGlobalReachConnection.ps1 index 58fc91bc1844..dd7772f764ef 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareGlobalReachConnection.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareGlobalReachConnection.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_tes .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareglobalreachconnection #> function Get-AzVMwareGlobalReachConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -160,7 +198,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -179,13 +217,18 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwarePlacementPolicy.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwarePlacementPolicy.ps1 index 93ce83bd42c3..9611948b65e2 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwarePlacementPolicy.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwarePlacementPolicy.ps1 @@ -27,12 +27,40 @@ Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudNam .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,14 +87,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareplacementpolicy #> function Get-AzVMwarePlacementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -74,6 +132,8 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('PlacementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -110,12 +170,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -167,7 +242,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,13 +261,19 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentity'; + GetViaIdentityCluster = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentityCluster'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloud.ps1 index cf7c461d8081..4544a5602aa7 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloud.ps1 @@ -29,7 +29,7 @@ Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_clou .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud .Notes COMPLEX PARAMETER PROPERTIES @@ -61,11 +61,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloud #> function Get-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -104,7 +105,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -156,7 +158,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -178,11 +180,15 @@ begin { List = 'Az.VMware.private\Get-AzVMwarePrivateCloud_List'; List1 = 'Az.VMware.private\Get-AzVMwarePrivateCloud_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloudAdminCredential.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloudAdminCredential.ps1 index 84f376eb50e1..90f04c9996b6 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloudAdminCredential.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwarePrivateCloudAdminCredential.ps1 @@ -23,12 +23,12 @@ List the admin credentials for the private cloud Get-AzVMwarePrivateCloudAdminCredential -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloudadmincredential #> function Get-AzVMwarePrivateCloudAdminCredential { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -56,7 +56,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -108,7 +109,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -127,11 +128,15 @@ begin { $mapping = @{ List = 'Az.VMware.private\Get-AzVMwarePrivateCloudAdminCredential_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Get-AzVMwareVirtualMachine.ps1 b/src/VMware/VMware.Autorest/exports/Get-AzVMwareVirtualMachine.ps1 index ca1d43d8b1fb..4922f0c5167e 100644 --- a/src/VMware/VMware.Autorest/exports/Get-AzVMwareVirtualMachine.ps1 +++ b/src/VMware/VMware.Autorest/exports/Get-AzVMwareVirtualMachine.ps1 @@ -27,12 +27,40 @@ Get-AzVMwareVirtualMachine -Id vm-209 -ClusterName cluster1 -PrivateCloudName cl .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,14 +87,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarevirtualmachine #> function Get-AzVMwareVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -74,6 +132,8 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('VirtualMachineId')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -110,12 +170,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -167,7 +242,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,13 +261,19 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareVirtualMachine_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareVirtualMachine_GetViaIdentity'; + GetViaIdentityCluster = 'Az.VMware.private\Get-AzVMwareVirtualMachine_GetViaIdentityCluster'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareVirtualMachine_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareVirtualMachine_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareAddon.ps1 index 6d0a48ba6a4b..d10b5f697735 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareAddon.ps1 @@ -24,19 +24,19 @@ $data = New-AzVMwareAddonVrPropertiesObject -VrsCount 2 New-AzVMwareAddon -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Property $data .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. PROPERTY : The properties of an addon resource - AddonType : The type of private cloud addon + AddonType : The type of private cloud addon .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon #> function New-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -61,7 +61,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties] # The properties of an addon resource # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, @@ -135,7 +135,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -154,11 +154,15 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.custom\New-AzVMwareAddon'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonSrmPropertiesObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonSrmPropertiesObject.ps1 index ea6230b18858..77292b593bea 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonSrmPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonSrmPropertiesObject.ps1 @@ -23,12 +23,12 @@ Create a in-memory object for AddonSrmProperties New-AzVMwareAddonSrmPropertiesObject -LicenseKey "YourLicenseKeyValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject #> function New-AzVMwareAddonSrmPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -47,7 +47,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -68,6 +68,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonVrPropertiesObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonVrPropertiesObject.ps1 index b7ebda5c5c89..63c5740e44fc 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonVrPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareAddonVrPropertiesObject.ps1 @@ -23,12 +23,12 @@ Create a in-memory object for AddonVrProperties New-AzVMwareAddonVrPropertiesObject -VrsCount 2 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject #> function New-AzVMwareAddonVrPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -47,7 +47,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -68,6 +68,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareAuthorization.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareAuthorization.ps1 index e8008d8bf3f9..f8297f3328d8 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareAuthorization.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareAuthorization.ps1 @@ -16,54 +16,132 @@ <# .Synopsis -Create or update an ExpressRoute Circuit Authorization in a private cloud +Create an ExpressRoute Circuit Authorization in a private cloud .Description -Create or update an ExpressRoute Circuit Authorization in a private cloud +Create an ExpressRoute Circuit Authorization in a private cloud .Example New-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareauthorization #> function New-AzVMwareAuthorization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('AuthorizationName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the ExpressRoute Circuit Authorization in the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -127,7 +205,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -145,12 +223,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareAuthorization_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareAuthorization_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareCloudLink.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareCloudLink.ps1 index 2818b8fcad21..dc1cfca369e1 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareCloudLink.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareCloudLink.ps1 @@ -16,48 +16,125 @@ <# .Synopsis -Create or update a cloud link in a private cloud +Create a cloud link in a private cloud .Description -Create or update a cloud link in a private cloud +Create a cloud link in a private cloud .Example New-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecloudlink #> function New-AzVMwareCloudLink { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('CloudLinkName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cloud link resource ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -69,7 +146,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -133,7 +211,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -151,12 +229,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareCloudLink_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareCloudLink_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareCluster.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareCluster.ps1 index 124cfe360391..1ffcce5f2333 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareCluster.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareCluster.ps1 @@ -16,48 +16,125 @@ <# .Synopsis -Create or update a cluster in a private cloud +Create a cluster in a private cloud .Description -Create or update a cluster in a private cloud +Create a cluster in a private cloud .Example New-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -ClusterSize 3 -SkuName av36 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecluster #> function New-AzVMwareCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -82,7 +159,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -146,7 +224,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -164,12 +242,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareCluster_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareCluster_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareCluster_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareDatastore.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareDatastore.ps1 index d1040c7c4a88..acd01e00bd69 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareDatastore.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareDatastore.ps1 @@ -16,54 +16,168 @@ <# .Synopsis -Create or update a datastore in a private cloud cluster +Create a datastore in a private cloud cluster .Description -Create or update a datastore in a private cloud cluster +Create a datastore in a private cloud cluster .Example New-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwaredatastore #> function New-AzVMwareDatastore { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('DatastoreName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the datastore in the private cloud cluster ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -71,9 +185,9 @@ param( ${DiskPoolVolumeLunName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum] + [System.String] # Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN ${DiskPoolVolumeMountOption}, @@ -94,7 +208,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -158,7 +273,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -176,12 +291,19 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateViaIdentityClusterExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareGlobalReachConnection.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareGlobalReachConnection.ps1 index f1347f9dc5ce..16b46b1433c1 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareGlobalReachConnection.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareGlobalReachConnection.ps1 @@ -16,48 +16,125 @@ <# .Synopsis -Create or update a global reach connection in a private cloud +Create a global reach connection in a private cloud .Description -Create or update a global reach connection in a private cloud +Create a global reach connection in a private cloud .Example New-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -AuthorizationKey "df530ffb-5a57-4437-a3eb-08e4c73ce011" -PeerExpressRouteResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/tnt16-cust-mp01-mock01/providers/Microsoft.Network/expressRouteCircuits/tnt16-cust-mp01-mock01-er" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareglobalreachconnection #> function New-AzVMwareGlobalReachConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the global reach connection in the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -81,7 +158,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -145,7 +223,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -163,12 +241,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareGlobalReachConnection_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareGlobalReachConnection_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareIdentitySourceObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareIdentitySourceObject.ps1 new file mode 100644 index 000000000000..01e24ac2b870 --- /dev/null +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareIdentitySourceObject.ps1 @@ -0,0 +1,172 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for IdentitySource. +.Description +Create an in-memory object for IdentitySource. +.Example +New-AzVMwareIdentitySourceObject -Alias test + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource +.Link +https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject +#> +function New-AzVMwareIdentitySourceObject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource])] +[CmdletBinding(PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The domain's NetBIOS name. + ${Alias}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The base distinguished name for groups. + ${BaseGroupDn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The base distinguished name for users. + ${BaseUserDn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The domain's dns name. + ${Domain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the identity source. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + ${Password}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Primary server URL. + ${PrimaryServer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Secondary server URL. + ${SecondaryServer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Protect LDAP communication using SSL certificate (LDAPS). + ${Ssl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group. + ${Username} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + __AllParameterSets = 'Az.VMware.custom\New-AzVMwareIdentitySourceObject'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwarePSCredentialExecutionParameterObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwarePSCredentialExecutionParameterObject.ps1 index 1d5931eaaebc..e53983ce0c89 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwarePSCredentialExecutionParameterObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwarePSCredentialExecutionParameterObject.ps1 @@ -23,12 +23,12 @@ Create a in-memory object for PSCredentialExecutionParameter New-AzVMwarePSCredentialExecutionParameterObject -Name azps_test_credentialvalue -Password "passwordValue" -Username "usernameValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PsCredentialExecutionParameter +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PsCredentialExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject #> function New-AzVMwarePSCredentialExecutionParameterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -59,7 +59,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -80,6 +80,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwarePlacementPolicy.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwarePlacementPolicy.ps1 index a8a1eb2a8b15..65ca91bcd8b6 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwarePlacementPolicy.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwarePlacementPolicy.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a placement policy in a private cloud cluster +Create a placement policy in a private cloud cluster .Description -Create or update a placement policy in a private cloud cluster +Create a placement policy in a private cloud cluster .Example $abc = New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -Property $abc @@ -26,60 +26,170 @@ New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudNam $abc = New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -Property $abc +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + PROPERTY : placement policy properties - Type : placement policy type + Type : placement policy type [DisplayName ]: Display name of the placement policy - [State ]: Whether the placement policy is enabled or disabled + [State ]: Whether the placement policy is enabled or disabled .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareplacementpolicy #> function New-AzVMwarePlacementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('PlacementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties] # placement policy properties # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, @@ -89,7 +199,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -153,7 +264,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -171,12 +282,19 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloud.ps1 index ede00f039a4e..669ae627aec8 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloud.ps1 @@ -16,19 +16,37 @@ <# .Synopsis -Create or update a private cloud +Create a private cloud .Description -Create or update a private cloud +Create a private cloud .Example New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +IDENTITYSOURCE : vCenter Single Sign On Identity Sources + [Alias ]: The domain's NetBIOS name + [BaseGroupDn ]: The base distinguished name for groups + [BaseUserDn ]: The base distinguished name for users + [Domain ]: The domain's dns name + [Name ]: The name of the identity source + [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + [PrimaryServer ]: Primary server URL + [SecondaryServer ]: Secondary server URL + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud #> function New-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -78,12 +96,89 @@ param( ${ManagementClusterSize}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.Int32] + # The secondary availability zone for the private cloud + ${AvailabilitySecondaryZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The availability strategy for the private cloud + ${AvailabilityStrategy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.Int32] + # The primary availability zone for the private cloud + ${AvailabilityZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Status of customer managed encryption key + ${EncryptionStatus}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] + # vCenter Single Sign On Identity Sources + # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. + ${IdentitySource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The type of identity used for the private cloud. + # The type 'SystemAssigned' refers to an implicitly created identity. + # The type 'None' will remove any identities from the Private Cloud. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the key. + ${KeyVaultPropertyKeyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The URL of the vault. + ${KeyVaultPropertyKeyVaultUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The version of the key. + ${KeyVaultPropertyKeyVersion}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # The hosts + ${ManagementClusterHost}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -92,7 +187,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -114,7 +209,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -178,7 +274,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -197,11 +293,15 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.custom\New-AzVMwarePrivateCloud'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudNsxtPassword.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudNsxtPassword.ps1 index 16913483836a..b8a25b82c1c4 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudNsxtPassword.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudNsxtPassword.ps1 @@ -57,6 +57,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudnsxtpassword #> @@ -96,7 +97,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -166,7 +168,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,11 +188,15 @@ begin { Rotate = 'Az.VMware.private\New-AzVMwarePrivateCloudNsxtPassword_Rotate'; RotateViaIdentity = 'Az.VMware.private\New-AzVMwarePrivateCloudNsxtPassword_RotateViaIdentity'; } - if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudVcenterPassword.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudVcenterPassword.ps1 index 701b47e11e74..1262e6c4b909 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudVcenterPassword.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwarePrivateCloudVcenterPassword.ps1 @@ -57,6 +57,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudvcenterpassword #> @@ -96,7 +97,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -166,7 +168,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -186,11 +188,15 @@ begin { Rotate = 'Az.VMware.private\New-AzVMwarePrivateCloudVcenterPassword_Rotate'; RotateViaIdentity = 'Az.VMware.private\New-AzVMwarePrivateCloudVcenterPassword_RotateViaIdentity'; } - if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 index 5512bd6dca1b..e75e30207ccb 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptSecureStringExecutionParameterObject.ps1 @@ -23,12 +23,12 @@ Create a in-memory object for ScriptSecureStringExecutionParameter New-AzVMwareScriptSecureStringExecutionParameterObject -Name azps_test_securevalue -SecureValue "passwordValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptSecureStringExecutionParameterObject #> function New-AzVMwareScriptSecureStringExecutionParameterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -53,7 +53,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -74,6 +74,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptStringExecutionParameterObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptStringExecutionParameterObject.ps1 index 07afade3c449..13c6614fd7c3 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptStringExecutionParameterObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareScriptStringExecutionParameterObject.ps1 @@ -20,15 +20,15 @@ Create a in-memory object for ScriptStringExecutionParameter .Description Create a in-memory object for ScriptStringExecutionParameter .Example -New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_stringvalue -Value "stringValue" +New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_value -Value "passwordValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptStringExecutionParameterObject #> function New-AzVMwareScriptStringExecutionParameterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -53,7 +53,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -74,6 +74,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 index 116e15a9471f..0fce3de63644 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareVMPlacementPolicyPropertiesObject.ps1 @@ -20,21 +20,21 @@ Create an in-memory object for VMPlacementPolicyProperties. .Description Create an in-memory object for VMPlacementPolicyProperties. .Example -New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"abc"="123"} + New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVMPlacementPolicyPropertiesObject #> function New-AzVMwareVMPlacementPolicyPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType] + [System.String] # placement policy affinity type. ${AffinityType}, @@ -45,9 +45,9 @@ param( ${VMMember}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType] + [System.String] # placement policy type. ${Type}, @@ -58,9 +58,9 @@ param( ${DisplayName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [System.String] # Whether the placement policy is enabled or disabled. ${State} ) @@ -74,7 +74,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -95,6 +95,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 b/src/VMware/VMware.Autorest/exports/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 index 3957898689e8..e61863cc4a9b 100644 --- a/src/VMware/VMware.Autorest/exports/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 +++ b/src/VMware/VMware.Autorest/exports/New-AzVMwareVmHostPlacementPolicyPropertiesObject.ps1 @@ -20,21 +20,21 @@ Create an in-memory object for VmHostPlacementPolicyProperties. .Description Create an in-memory object for VmHostPlacementPolicyProperties. .Example -New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"abc"="123"} -Type 'VmHost' -VMMember @{"abc"="123"} +New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMHostPlacementPolicyProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMHostPlacementPolicyProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVmHostPlacementPolicyPropertiesObject #> function New-AzVMwareVmHostPlacementPolicyPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VmHostPlacementPolicyProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VmHostPlacementPolicyProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType] + [System.String] # placement policy affinity type. ${AffinityType}, @@ -51,9 +51,9 @@ param( ${VMMember}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType] + [System.String] # placement policy type. ${Type}, @@ -64,9 +64,9 @@ param( ${DisplayName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [System.String] # Whether the placement policy is enabled or disabled. ${State} ) @@ -80,7 +80,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -101,6 +101,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/ProxyCmdletDefinitions.ps1 b/src/VMware/VMware.Autorest/exports/ProxyCmdletDefinitions.ps1 index 381d9ef6569c..fd7be46f4a54 100644 --- a/src/VMware/VMware.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/src/VMware/VMware.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName a .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareauthorization #> function Get-AzVMwareAuthorization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('AuthorizationName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -160,7 +198,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -179,13 +217,18 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareAuthorization_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareAuthorization_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareAuthorization_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareAuthorization_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -243,7 +286,7 @@ Get-AzVMwareCloudLink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_ .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink .Notes COMPLEX PARAMETER PROPERTIES @@ -275,14 +318,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecloudlink #> function Get-AzVMwareCloudLink { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('CloudLinkName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -319,12 +392,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -376,7 +457,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -395,13 +476,18 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareCloudLink_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareCloudLink_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareCloudLink_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareCloudLink_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -448,99 +534,54 @@ end { <# .Synopsis -Get a cluster by name in a private cloud +List hosts by zone in a cluster .Description -Get a cluster by name in a private cloud -.Example -Get-AzVMwareCluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +List hosts by zone in a cluster .Example -Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +Get-AzVMwareClusterZone -PrivateCloudName SDDC2 -ResourceGroupName TestSddc-rg -ClusterName Cluster-1 -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster -.Notes -COMPLEX PARAMETER PROPERTIES - -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. - -INPUTOBJECT : Identity Parameter - [AddonName ]: Name of the addon for the private cloud - [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud - [CloudLinkName ]: Name of the cloud link resource - [ClusterName ]: Name of the cluster in the private cloud - [DatastoreName ]: Name of the datastore in the private cloud cluster - [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name - [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name - [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name - [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud - [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud - [Id ]: Resource identity path - [Location ]: Azure region - [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name - [PrivateCloudName ]: Name of the private cloud - [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name - [ResourceGroupName ]: The name of the resource group. The name is case insensitive. - [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud - [ScriptExecutionName ]: Name of the user-invoked script execution resource - [ScriptPackageName ]: Name of the script package in the private cloud - [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name - [SubscriptionId ]: The ID of the target subscription. - [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name - [VirtualMachineId ]: Virtual Machine identifier +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList .Link -https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecluster +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareclusterzone #> -function Get-AzVMwareCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +function Get-AzVMwareClusterZone { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('ClusterName')] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud - ${Name}, + ${ClusterName}, - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='Get')] - [Parameter(ParameterSetName='List')] + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -592,7 +633,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -609,15 +650,17 @@ begin { } $mapping = @{ - Get = 'Az.VMware.private\Get-AzVMwareCluster_Get'; - GetViaIdentity = 'Az.VMware.private\Get-AzVMwareCluster_GetViaIdentity'; - List = 'Az.VMware.private\Get-AzVMwareCluster_List'; + List = 'Az.VMware.private\Get-AzVMwareClusterZone_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -664,18 +707,18 @@ end { <# .Synopsis -Get a datastore in a private cloud cluster +Get a cluster by name in a private cloud .Description -Get a datastore in a private cloud cluster +Get a cluster by name in a private cloud .Example -Get-AzVMwareDatastore -ClusterName azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +Get-AzVMwareCluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Example -Get-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -707,25 +750,48 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwaredatastore +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecluster #> -function Get-AzVMwareDatastore { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore])] +function Get-AzVMwareCluster { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud - ${ClusterName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('DatastoreName')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the datastore in the private cloud cluster ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] @@ -758,12 +824,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -815,7 +889,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -832,15 +906,20 @@ begin { } $mapping = @{ - Get = 'Az.VMware.private\Get-AzVMwareDatastore_Get'; - GetViaIdentity = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentity'; - List = 'Az.VMware.private\Get-AzVMwareDatastore_List'; + Get = 'Az.VMware.private\Get-AzVMwareCluster_Get'; + GetViaIdentity = 'Az.VMware.private\Get-AzVMwareCluster_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareCluster_GetViaIdentityPrivateCloud'; + List = 'Az.VMware.private\Get-AzVMwareCluster_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -887,23 +966,51 @@ end { <# .Synopsis -Get a global reach connection by name in a private cloud +Get a datastore in a private cloud cluster .Description -Get a global reach connection by name in a private cloud +Get a datastore in a private cloud cluster .Example -Get-AzVMwareGlobalReachConnection -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +Get-AzVMwareDatastore -ClusterName azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Example -Get-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +Get-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -930,18 +1037,57 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareglobalreachconnection +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwaredatastore #> -function Get-AzVMwareGlobalReachConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection])] +function Get-AzVMwareDatastore { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('GlobalReachConnectionName')] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] - # Name of the global reach connection in the private cloud + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Alias('DatastoreName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the datastore in the private cloud cluster ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] @@ -974,12 +1120,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1031,7 +1192,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1048,15 +1209,21 @@ begin { } $mapping = @{ - Get = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_Get'; - GetViaIdentity = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_GetViaIdentity'; - List = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_List'; + Get = 'Az.VMware.private\Get-AzVMwareDatastore_Get'; + GetViaIdentity = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentity'; + GetViaIdentityCluster = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentityCluster'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareDatastore_GetViaIdentityPrivateCloud'; + List = 'Az.VMware.private\Get-AzVMwareDatastore_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1103,18 +1270,18 @@ end { <# .Synopsis -Get a placement policy by name in a private cloud cluster +Get a global reach connection by name in a private cloud .Description -Get a placement policy by name in a private cloud cluster +Get a global reach connection by name in a private cloud .Example -Get-AzVMwarePlacementPolicy -ClusterName cluster1 -PrivateCloudName cloud1 -ResourceGroupName group1 +Get-AzVMwareGlobalReachConnection -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Example -Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 +Get-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection .Notes COMPLEX PARAMETER PROPERTIES @@ -1146,25 +1313,48 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareplacementpolicy +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareglobalreachconnection #> -function Get-AzVMwarePlacementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy])] +function Get-AzVMwareGlobalReachConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the cluster in the private cloud - ${ClusterName}, - - [Parameter(ParameterSetName='Get', Mandatory)] - [Alias('PlacementPolicyName')] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] - # Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + # Name of the global reach connection in the private cloud ${Name}, [Parameter(ParameterSetName='Get', Mandatory)] @@ -1197,12 +1387,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1254,7 +1452,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1271,15 +1469,20 @@ begin { } $mapping = @{ - Get = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_Get'; - GetViaIdentity = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentity'; - List = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_List'; + Get = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_Get'; + GetViaIdentity = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud'; + List = 'Az.VMware.private\Get-AzVMwareGlobalReachConnection_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1326,47 +1529,181 @@ end { <# .Synopsis -List the admin credentials for the private cloud +Get a placement policy by name in a private cloud cluster .Description -List the admin credentials for the private cloud +Get a placement policy by name in a private cloud cluster .Example -Get-AzVMwarePrivateCloudAdminCredential -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +Get-AzVMwarePlacementPolicy -ClusterName cluster1 -PrivateCloudName cloud1 -ResourceGroupName group1 +.Example +Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloudadmincredential +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareplacementpolicy #> -function Get-AzVMwarePrivateCloudAdminCredential { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Get-AzVMwarePlacementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Alias('PlacementPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String[]] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1418,7 +1755,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1435,13 +1772,21 @@ begin { } $mapping = @{ - List = 'Az.VMware.private\Get-AzVMwarePrivateCloudAdminCredential_List'; + Get = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_Get'; + GetViaIdentity = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentity'; + GetViaIdentityCluster = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentityCluster'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_GetViaIdentityPrivateCloud'; + List = 'Az.VMware.private\Get-AzVMwarePlacementPolicy_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1488,24 +1833,191 @@ end { <# .Synopsis -Get a private cloud +List the admin credentials for the private cloud .Description -Get a private cloud -.Example -Get-AzVMwarePrivateCloud -.Example -Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group +List the admin credentials for the private cloud .Example -Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud +Get-AzVMwarePrivateCloudAdminCredential -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -.Inputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud -.Notes -COMPLEX PARAMETER PROPERTIES +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials +.Link +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloudadmincredential +#> +function Get-AzVMwarePrivateCloudAdminCredential { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, -To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.VMware.private\Get-AzVMwarePrivateCloudAdminCredential_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get a private cloud +.Description +Get a private cloud +.Example +Get-AzVMwarePrivateCloud +.Example +Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group +.Example +Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud @@ -1533,11 +2045,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloud #> function Get-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1576,7 +2089,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1628,7 +2142,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1650,11 +2164,15 @@ begin { List = 'Az.VMware.private\Get-AzVMwarePrivateCloud_List'; List1 = 'Az.VMware.private\Get-AzVMwarePrivateCloud_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1712,12 +2230,40 @@ Get-AzVMwareVirtualMachine -Id vm-209 -ClusterName cluster1 -PrivateCloudName cl .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -1744,14 +2290,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarevirtualmachine #> function Get-AzVMwareVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -1759,6 +2335,8 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('VirtualMachineId')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -1795,12 +2373,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1852,7 +2445,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -1871,13 +2464,19 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareVirtualMachine_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareVirtualMachine_GetViaIdentity'; + GetViaIdentityCluster = 'Az.VMware.private\Get-AzVMwareVirtualMachine_GetViaIdentityCluster'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareVirtualMachine_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareVirtualMachine_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -1924,54 +2523,132 @@ end { <# .Synopsis -Create or update an ExpressRoute Circuit Authorization in a private cloud +Create an ExpressRoute Circuit Authorization in a private cloud .Description -Create or update an ExpressRoute Circuit Authorization in a private cloud +Create an ExpressRoute Circuit Authorization in a private cloud .Example New-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization -.Link -https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareauthorization -#> -function New-AzVMwareAuthorization { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Alias('AuthorizationName')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the ExpressRoute Circuit Authorization in the private cloud - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # The name of the private cloud. - ${PrivateCloudName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization +.Notes +COMPLEX PARAMETER PROPERTIES - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareauthorization +#> +function New-AzVMwareAuthorization { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('AuthorizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the ExpressRoute Circuit Authorization in the private cloud + ${Name}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the private cloud. + ${PrivateCloudName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -2035,7 +2712,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2053,12 +2730,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareAuthorization_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareAuthorization_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2105,48 +2788,125 @@ end { <# .Synopsis -Create or update a cloud link in a private cloud +Create a cloud link in a private cloud .Description -Create or update a cloud link in a private cloud +Create a cloud link in a private cloud .Example New-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecloudlink #> function New-AzVMwareCloudLink { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('CloudLinkName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cloud link resource ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -2158,7 +2918,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -2222,7 +2983,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2240,12 +3001,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareCloudLink_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareCloudLink_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2292,48 +3059,125 @@ end { <# .Synopsis -Create or update a cluster in a private cloud +Create a cluster in a private cloud .Description -Create or update a cluster in a private cloud +Create a cluster in a private cloud .Example New-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -ClusterSize 3 -SkuName av36 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecluster #> function New-AzVMwareCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -2358,7 +3202,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -2422,7 +3267,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2440,12 +3285,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareCluster_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareCluster_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareCluster_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2492,54 +3343,168 @@ end { <# .Synopsis -Create or update a datastore in a private cloud cluster +Create a datastore in a private cloud cluster .Description -Create or update a datastore in a private cloud cluster +Create a datastore in a private cloud cluster .Example New-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore -.Link -https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwaredatastore -#> -function New-AzVMwareDatastore { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the cluster in the private cloud - ${ClusterName}, +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore +.Notes +COMPLEX PARAMETER PROPERTIES - [Parameter(Mandatory)] +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwaredatastore +#> +function New-AzVMwareDatastore { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('DatastoreName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the datastore in the private cloud cluster ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -2547,9 +3512,9 @@ param( ${DiskPoolVolumeLunName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum] + [System.String] # Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN ${DiskPoolVolumeMountOption}, @@ -2570,7 +3535,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -2634,7 +3600,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2652,12 +3618,19 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateViaIdentityClusterExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2704,48 +3677,125 @@ end { <# .Synopsis -Create or update a global reach connection in a private cloud +Create a global reach connection in a private cloud .Description -Create or update a global reach connection in a private cloud +Create a global reach connection in a private cloud .Example New-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -AuthorizationKey "df530ffb-5a57-4437-a3eb-08e4c73ce011" -PeerExpressRouteResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/tnt16-cust-mp01-mock01/providers/Microsoft.Network/expressRouteCircuits/tnt16-cust-mp01-mock01-er" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareglobalreachconnection #> function New-AzVMwareGlobalReachConnection { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the global reach connection in the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -2769,7 +3819,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -2833,7 +3884,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -2851,12 +3902,18 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareGlobalReachConnection_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareGlobalReachConnection_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -2903,9 +3960,9 @@ end { <# .Synopsis -Create or update a placement policy in a private cloud cluster +Create a placement policy in a private cloud cluster .Description -Create or update a placement policy in a private cloud cluster +Create a placement policy in a private cloud cluster .Example $abc = New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -Property $abc @@ -2913,60 +3970,170 @@ New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudNam $abc = New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -Property $abc +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -PROPERTY : placement policy properties - Type : placement policy type - [DisplayName ]: Display name of the placement policy - [State ]: Whether the placement policy is enabled or disabled -.Link -https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareplacementpolicy -#> -function New-AzVMwarePlacementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the cluster in the private cloud - ${ClusterName}, - - [Parameter(Mandatory)] - [Alias('PlacementPolicyName')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - ${Name}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the private cloud - ${PrivateCloudName}, - - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # The name of the resource group. - # The name is case insensitive. - ${ResourceGroupName}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PROPERTY : placement policy properties + Type : placement policy type + [DisplayName ]: Display name of the placement policy + [State ]: Whether the placement policy is enabled or disabled +.Link +https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareplacementpolicy +#> +function New-AzVMwarePlacementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('PlacementPolicyName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + ${Name}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties] # placement policy properties # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, @@ -2976,7 +4143,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3040,7 +4208,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3058,12 +4226,19 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3151,6 +4326,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudnsxtpassword #> @@ -3190,7 +4366,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3260,7 +4437,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3280,11 +4457,15 @@ begin { Rotate = 'Az.VMware.private\New-AzVMwarePrivateCloudNsxtPassword_Rotate'; RotateViaIdentity = 'Az.VMware.private\New-AzVMwarePrivateCloudNsxtPassword_RotateViaIdentity'; } - if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3372,6 +4553,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudvcenterpassword #> @@ -3411,7 +4593,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3481,7 +4664,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3501,11 +4684,15 @@ begin { Rotate = 'Az.VMware.private\New-AzVMwarePrivateCloudVcenterPassword_Rotate'; RotateViaIdentity = 'Az.VMware.private\New-AzVMwarePrivateCloudVcenterPassword_RotateViaIdentity'; } - if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Rotate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3597,6 +4784,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareauthorization #> @@ -3605,6 +4821,7 @@ function Remove-AzVMwareAuthorization { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('AuthorizationName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -3638,12 +4855,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3713,7 +4938,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3732,12 +4957,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareAuthorization_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareAuthorization_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareAuthorization_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -3829,6 +5059,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecloudlink #> @@ -3837,6 +5096,7 @@ function Remove-AzVMwareCloudLink { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('CloudLinkName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -3870,12 +5130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3945,7 +5213,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -3964,12 +5232,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareCloudLink_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareCloudLink_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareCloudLink_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4061,6 +5334,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecluster #> @@ -4069,6 +5371,7 @@ function Remove-AzVMwareCluster { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -4102,12 +5405,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4177,7 +5488,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -4196,12 +5507,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareCluster_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareCluster_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareCluster_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4265,7 +5581,7 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +CLUSTERINPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud [CloudLinkName ]: Name of the cloud link resource @@ -4291,31 +5607,91 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier -.Link -https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwaredatastore -#> -function Remove-AzVMwareDatastore { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the cluster in the private cloud - ${ClusterName}, - - [Parameter(ParameterSetName='Delete', Mandatory)] - [Alias('DatastoreName')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the datastore in the private cloud cluster - ${Name}, + [WorkloadNetworkName ]: Name for the workload network in the private cloud - [Parameter(ParameterSetName='Delete', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the private cloud - ${PrivateCloudName}, +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwaredatastore +#> +function Remove-AzVMwareDatastore { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] + [Alias('DatastoreName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the datastore in the private cloud cluster + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, [Parameter(ParameterSetName='Delete', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] @@ -4338,12 +5714,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4413,7 +5804,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -4432,12 +5823,18 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareDatastore_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareDatastore_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.VMware.private\Remove-AzVMwareDatastore_DeleteViaIdentityCluster'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareDatastore_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4529,6 +5926,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareglobalreachconnection #> @@ -4537,6 +5963,7 @@ function Remove-AzVMwareGlobalReachConnection { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -4570,12 +5997,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4645,7 +6080,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -4664,12 +6099,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareGlobalReachConnection_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareGlobalReachConnection_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4735,6 +6175,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -4761,6 +6229,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareplacementpolicy #> @@ -4769,12 +6266,15 @@ function Remove-AzVMwarePlacementPolicy { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('PlacementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -4808,12 +6308,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4883,7 +6398,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -4902,12 +6417,18 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_DeleteViaIdentityCluster'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -4961,12 +6482,12 @@ Return quota for subscription by region Test-AzVMwareLocationQuotaAvailability -Location centralus .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota .Link https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationquotaavailability #> function Test-AzVMwareLocationQuotaAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota])] [CmdletBinding(DefaultParameterSetName='Check', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -4987,7 +6508,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -5039,7 +6561,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5058,11 +6580,15 @@ begin { $mapping = @{ Check = 'Az.VMware.private\Test-AzVMwareLocationQuotaAvailability_Check'; } - if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -5113,38 +6639,1186 @@ Return trial status for subscription by region .Description Return trial status for subscription by region .Example -Test-AzVMwareLocationTrialAvailability -Location westcentralus +Test-AzVMwareLocationTrialAvailability -Location westcentralus -Name av36 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial +.Link +https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability +#> +function Test-AzVMwareLocationTrialAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Azure region + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the SKU. + ${Name}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CheckExpanded = 'Az.VMware.private\Test-AzVMwareLocationTrialAvailability_CheckExpanded'; + } + if (('CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create an ExpressRoute Circuit Authorization in a private cloud +.Description +Create an ExpressRoute Circuit Authorization in a private cloud +.Example +Update-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareauthorization +#> +function Update-AzVMwareAuthorization { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('AuthorizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the ExpressRoute Circuit Authorization in the private cloud + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the private cloud. + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareAuthorization_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareAuthorization_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create a cloud link in a private cloud +.Description +Create a cloud link in a private cloud +.Example +Update-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecloudlink +#> +function Update-AzVMwareCloudLink { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('CloudLinkName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cloud link resource + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the private cloud. + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Identifier of the other private cloud participating in the link. + ${LinkedCloud}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareCloudLink_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareCloudLink_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update a cluster in a private cloud +.Description +Update a cluster in a private cloud +.Example +Update-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -ClusterSize 4 +.Example +Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Update-AzVMwareCluster -ClusterSize 4 + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecluster +#> +function Update-AzVMwareCluster { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('ClusterName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.Int32] + # The cluster size + ${ClusterSize}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # The hosts + ${PropertiesHost}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create a datastore in a private cloud cluster +.Description +Create a datastore in a private cloud cluster +.Example +Update-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwaredatastore #> -function Test-AzVMwareLocationTrialAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial])] -[CmdletBinding(DefaultParameterSetName='Check', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Update-AzVMwareDatastore { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] - # Azure region - ${Location}, + # Name of the cluster in the private cloud + ${ClusterName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('DatastoreName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the datastore in the private cloud cluster + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Name of the LUN to be used for datastore + ${DiskPoolVolumeLunName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + ${DiskPoolVolumeMountOption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Azure resource ID of the iSCSI target + ${DiskPoolVolumeTargetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Azure resource ID of the NetApp volume + ${NetAppVolumeId}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -5165,6 +7839,12 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] [System.Uri] @@ -5194,7 +7874,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5211,13 +7891,20 @@ begin { } $mapping = @{ - Check = 'Az.VMware.private\Test-AzVMwareLocationTrialAvailability_Check'; + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateViaIdentityClusterExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded'; } - if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -5264,18 +7951,16 @@ end { <# .Synopsis -Update a cluster in a private cloud +Create a global reach connection in a private cloud .Description -Update a cluster in a private cloud -.Example -Update-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -ClusterSize 4 +Create a global reach connection in a private cloud .Example -Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Update-AzVMwareCluster -ClusterSize 4 +Update-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection .Notes COMPLEX PARAMETER PROPERTIES @@ -5307,24 +7992,54 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecluster +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareglobalreachconnection #> -function Update-AzVMwareCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster])] +function Update-AzVMwareGlobalReachConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] - [Alias('ClusterName')] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] - # Name of the cluster in the private cloud + # Name of the global reach connection in the private cloud ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] - # Name of the private cloud + # The name of the private cloud. ${PrivateCloudName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -5348,25 +8063,38 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [System.Int32] - # The cluster size - ${ClusterSize}, + [System.String] + # Authorization key from the peer express route used for the global reach connection + ${AuthorizationKey}, [Parameter()] - [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [System.String[]] - # The hosts - ${PropertiesHost}, + [System.String] + # The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + ${ExpressRouteId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Identifier of the ExpressRoute Circuit to peer with in the global reach connection + ${PeerExpressRouteCircuit}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5430,7 +8158,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5447,14 +8175,19 @@ begin { } $mapping = @{ - UpdateExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateExpanded'; - UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateViaIdentityExpanded'; + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareGlobalReachConnection_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareGlobalReachConnection_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -5512,12 +8245,40 @@ Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudNam .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -5544,20 +8305,52 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareplacementpolicy #> function Update-AzVMwarePlacementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('PlacementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -5584,6 +8377,13 @@ param( # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] @@ -5591,6 +8391,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # vm-host placement policy affinity strength (should/must) + ${AffinityStrength}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # placement policy azure hybrid benefit opt-in type + ${AzureHybridBenefitType}, + [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] @@ -5599,9 +8420,9 @@ param( ${HostMember}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [System.String] # Whether the placement policy is enabled or disabled ${State}, @@ -5617,7 +8438,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5681,7 +8503,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -5699,13 +8521,19 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -5763,7 +8591,7 @@ Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_clou .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud .Notes COMPLEX PARAMETER PROPERTIES @@ -5778,7 +8606,7 @@ IDENTITYSOURCE : vCenter Single Sign On Identity Sources [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. [PrimaryServer ]: Primary server URL [SecondaryServer ]: Secondary server URL - [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group INPUTOBJECT : Identity Parameter @@ -5807,11 +8635,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareprivatecloud #> function Update-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -5832,63 +8661,53 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] - # The ID of the target subscription. - ${SubscriptionId}, - - [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] - # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. - ${InputObject}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [System.Int32] - # The secondary availability zone for the private cloud - ${AvailabilitySecondaryZone}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy] - # The availability strategy for the private cloud - ${AvailabilityStrategy}, + # The ID of the target subscription. + ${SubscriptionId}, - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [System.Int32] - # The primary availability zone for the private cloud - ${AvailabilityZone}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState] + [System.String] # Status of customer managed encryption key ${EncryptionStatus}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]] + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] # vCenter Single Sign On Identity Sources # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. ${IdentitySource}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType] + [System.String] # The type of identity used for the private cloud. # The type 'SystemAssigned' refers to an implicitly created identity. # The type 'None' will remove any identities from the Private Cloud. ${IdentityType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, @@ -5925,7 +8744,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -5935,7 +8754,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5999,7 +8819,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6019,11 +8839,15 @@ begin { UpdateExpanded = 'Az.VMware.private\Update-AzVMwarePrivateCloud_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwarePrivateCloud_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6081,7 +8905,7 @@ Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES @@ -6113,11 +8937,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon #> function Get-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='List', Mandatory)] @@ -6214,7 +9039,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6235,11 +9060,15 @@ begin { Get = 'Az.VMware.custom\Get-AzVMwareAddon'; GetViaIdentity = 'Az.VMware.custom\Get-AzVMwareAddon'; } - if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('List', 'Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6294,19 +9123,19 @@ $data = New-AzVMwareAddonVrPropertiesObject -VrsCount 2 New-AzVMwareAddon -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Property $data .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. PROPERTY : The properties of an addon resource - AddonType : The type of private cloud addon + AddonType : The type of private cloud addon .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon #> function New-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -6331,7 +9160,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties] # The properties of an addon resource # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, @@ -6405,7 +9234,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6424,11 +9253,15 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.custom\New-AzVMwareAddon'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6482,12 +9315,12 @@ Create a in-memory object for AddonSrmProperties New-AzVMwareAddonSrmPropertiesObject -LicenseKey "YourLicenseKeyValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject #> function New-AzVMwareAddonSrmPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonSrmProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -6506,7 +9339,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6527,6 +9360,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6580,12 +9417,12 @@ Create a in-memory object for AddonVrProperties New-AzVMwareAddonVrPropertiesObject -VrsCount 2 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject #> function New-AzVMwareAddonVrPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonVrProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -6604,7 +9441,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6625,6 +9462,167 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create an in-memory object for IdentitySource. +.Description +Create an in-memory object for IdentitySource. +.Example +New-AzVMwareIdentitySourceObject -Alias test + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource +.Link +https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject +#> +function New-AzVMwareIdentitySourceObject { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource])] +[CmdletBinding(PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The domain's NetBIOS name. + ${Alias}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The base distinguished name for groups. + ${BaseGroupDn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The base distinguished name for users. + ${BaseUserDn}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The domain's dns name. + ${Domain}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the identity source. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + ${Password}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Primary server URL. + ${PrimaryServer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Secondary server URL. + ${SecondaryServer}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Protect LDAP communication using SSL certificate (LDAPS). + ${Ssl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group. + ${Username} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + __AllParameterSets = 'Az.VMware.custom\New-AzVMwareIdentitySourceObject'; + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6671,19 +9669,37 @@ end { <# .Synopsis -Create or update a private cloud +Create a private cloud .Description -Create or update a private cloud +Create a private cloud .Example New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +IDENTITYSOURCE : vCenter Single Sign On Identity Sources + [Alias ]: The domain's NetBIOS name + [BaseGroupDn ]: The base distinguished name for groups + [BaseUserDn ]: The base distinguished name for users + [Domain ]: The domain's dns name + [Name ]: The name of the identity source + [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + [PrimaryServer ]: Primary server URL + [SecondaryServer ]: Secondary server URL + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud #> function New-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -6733,12 +9749,89 @@ param( ${ManagementClusterSize}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.Int32] + # The secondary availability zone for the private cloud + ${AvailabilitySecondaryZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The availability strategy for the private cloud + ${AvailabilityStrategy}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.Int32] + # The primary availability zone for the private cloud + ${AvailabilityZone}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Status of customer managed encryption key + ${EncryptionStatus}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] + # vCenter Single Sign On Identity Sources + # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. + ${IdentitySource}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The type of identity used for the private cloud. + # The type 'SystemAssigned' refers to an implicitly created identity. + # The type 'None' will remove any identities from the Private Cloud. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the key. + ${KeyVaultPropertyKeyName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The URL of the vault. + ${KeyVaultPropertyKeyVaultUrl}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The version of the key. + ${KeyVaultPropertyKeyVersion}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String[]] + # The hosts + ${ManagementClusterHost}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -6747,7 +9840,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -6769,7 +9862,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -6833,7 +9927,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6852,11 +9946,15 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.custom\New-AzVMwarePrivateCloud'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -6910,12 +10008,12 @@ Create a in-memory object for PSCredentialExecutionParameter New-AzVMwarePSCredentialExecutionParameterObject -Name azps_test_credentialvalue -Password "passwordValue" -Username "usernameValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PsCredentialExecutionParameter +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PsCredentialExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject #> function New-AzVMwarePSCredentialExecutionParameterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PSCredentialExecutionParameter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PSCredentialExecutionParameter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -6946,7 +10044,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -6967,6 +10065,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7020,12 +10122,12 @@ Create a in-memory object for ScriptSecureStringExecutionParameter New-AzVMwareScriptSecureStringExecutionParameterObject -Name azps_test_securevalue -SecureValue "passwordValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptSecureStringExecutionParameterObject #> function New-AzVMwareScriptSecureStringExecutionParameterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptSecureStringExecutionParameter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -7050,7 +10152,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7071,6 +10173,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7121,15 +10227,15 @@ Create a in-memory object for ScriptStringExecutionParameter .Description Create a in-memory object for ScriptStringExecutionParameter .Example -New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_stringvalue -Value "stringValue" +New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_value -Value "passwordValue" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptStringExecutionParameterObject #> function New-AzVMwareScriptStringExecutionParameterObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptStringExecutionParameter])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -7154,7 +10260,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7175,6 +10281,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7225,21 +10335,21 @@ Create an in-memory object for VmHostPlacementPolicyProperties. .Description Create an in-memory object for VmHostPlacementPolicyProperties. .Example -New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"abc"="123"} -Type 'VmHost' -VMMember @{"abc"="123"} +New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMHostPlacementPolicyProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMHostPlacementPolicyProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVmHostPlacementPolicyPropertiesObject #> function New-AzVMwareVmHostPlacementPolicyPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VmHostPlacementPolicyProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VmHostPlacementPolicyProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType] + [System.String] # placement policy affinity type. ${AffinityType}, @@ -7256,9 +10366,9 @@ param( ${VMMember}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType] + [System.String] # placement policy type. ${Type}, @@ -7269,9 +10379,9 @@ param( ${DisplayName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [System.String] # Whether the placement policy is enabled or disabled. ${State} ) @@ -7285,7 +10395,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7306,6 +10416,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7356,21 +10470,21 @@ Create an in-memory object for VMPlacementPolicyProperties. .Description Create an in-memory object for VMPlacementPolicyProperties. .Example -New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"abc"="123"} + New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties .Link https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVMPlacementPolicyPropertiesObject #> function New-AzVMwareVMPlacementPolicyPropertiesObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VMPlacementPolicyProperties])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType] + [System.String] # placement policy affinity type. ${AffinityType}, @@ -7381,9 +10495,9 @@ param( ${VMMember}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType] + [System.String] # placement policy type. ${Type}, @@ -7394,9 +10508,9 @@ param( ${DisplayName}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [System.String] # Whether the placement policy is enabled or disabled. ${State} ) @@ -7410,7 +10524,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7431,6 +10545,10 @@ begin { } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7522,6 +10640,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareaddon #> @@ -7638,7 +10757,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7658,11 +10777,15 @@ begin { Delete = 'Az.VMware.custom\Remove-AzVMwareAddon'; DeleteViaIdentity = 'Az.VMware.custom\Remove-AzVMwareAddon'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) @@ -7754,6 +10877,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareprivatecloud #> @@ -7864,7 +10988,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -7884,11 +11008,15 @@ begin { Delete = 'Az.VMware.custom\Remove-AzVMwarePrivateCloud'; DeleteViaIdentity = 'Az.VMware.custom\Remove-AzVMwarePrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAddon.ps1 index 6007a524f585..62c9a8b0b3e6 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAddon.ps1 @@ -61,6 +61,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareaddon #> @@ -177,7 +178,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -197,11 +198,15 @@ begin { Delete = 'Az.VMware.custom\Remove-AzVMwareAddon'; DeleteViaIdentity = 'Az.VMware.custom\Remove-AzVMwareAddon'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAuthorization.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAuthorization.ps1 index 0a9eb6ab3192..ec33bbcfcb93 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAuthorization.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareAuthorization.ps1 @@ -61,6 +61,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareauthorization #> @@ -69,6 +98,7 @@ function Remove-AzVMwareAuthorization { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('AuthorizationName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -102,12 +132,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,7 +215,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -196,12 +234,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareAuthorization_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareAuthorization_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareAuthorization_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCloudLink.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCloudLink.ps1 index 81ef79d681f0..5d842e97f0b6 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCloudLink.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCloudLink.ps1 @@ -61,6 +61,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecloudlink #> @@ -69,6 +98,7 @@ function Remove-AzVMwareCloudLink { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('CloudLinkName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -102,12 +132,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,7 +215,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -196,12 +234,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareCloudLink_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareCloudLink_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareCloudLink_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCluster.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCluster.ps1 index 97179b72e89b..d557cd5c14fb 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCluster.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareCluster.ps1 @@ -61,6 +61,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecluster #> @@ -69,6 +98,7 @@ function Remove-AzVMwareCluster { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -102,12 +132,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,7 +215,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -196,12 +234,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareCluster_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareCluster_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareCluster_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareDatastore.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareDatastore.ps1 index 30ed8171a4b2..a17f9a35ba89 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareDatastore.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareDatastore.ps1 @@ -33,6 +33,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,6 +87,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwaredatastore #> @@ -67,12 +124,15 @@ function Remove-AzVMwareDatastore { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('DatastoreName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -106,12 +166,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -181,7 +256,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -200,12 +275,18 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareDatastore_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareDatastore_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.VMware.private\Remove-AzVMwareDatastore_DeleteViaIdentityCluster'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareDatastore_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareGlobalReachConnection.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareGlobalReachConnection.ps1 index 0934806d548e..892069d091e0 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwareGlobalReachConnection.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwareGlobalReachConnection.ps1 @@ -61,6 +61,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareglobalreachconnection #> @@ -69,6 +98,7 @@ function Remove-AzVMwareGlobalReachConnection { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('GlobalReachConnectionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -102,12 +132,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,7 +215,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -196,12 +234,17 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareGlobalReachConnection_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareGlobalReachConnection_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePlacementPolicy.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePlacementPolicy.ps1 index 4d0a58e5de95..7f8afffa4dcb 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePlacementPolicy.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePlacementPolicy.ps1 @@ -35,6 +35,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -61,6 +89,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareplacementpolicy #> @@ -69,12 +126,15 @@ function Remove-AzVMwarePlacementPolicy { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('PlacementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -108,12 +168,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -183,7 +258,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -202,12 +277,18 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_DeleteViaIdentityCluster'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePrivateCloud.ps1 index 06b68be3f2ae..85b247e24794 100644 --- a/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/exports/Remove-AzVMwarePrivateCloud.ps1 @@ -61,6 +61,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareprivatecloud #> @@ -171,7 +172,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -191,11 +192,15 @@ begin { Delete = 'Az.VMware.custom\Remove-AzVMwarePrivateCloud'; DeleteViaIdentity = 'Az.VMware.custom\Remove-AzVMwarePrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationQuotaAvailability.ps1 b/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationQuotaAvailability.ps1 index 4c00637bac6c..6cd6338626d2 100644 --- a/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationQuotaAvailability.ps1 +++ b/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationQuotaAvailability.ps1 @@ -23,12 +23,12 @@ Return quota for subscription by region Test-AzVMwareLocationQuotaAvailability -Location centralus .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota .Link https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationquotaavailability #> function Test-AzVMwareLocationQuotaAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota])] [CmdletBinding(DefaultParameterSetName='Check', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -49,7 +49,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -101,7 +102,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -120,11 +121,15 @@ begin { $mapping = @{ Check = 'Az.VMware.private\Test-AzVMwareLocationQuotaAvailability_Check'; } - if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationTrialAvailability.ps1 b/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationTrialAvailability.ps1 index d9956e576500..6c2d424178a9 100644 --- a/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationTrialAvailability.ps1 +++ b/src/VMware/VMware.Autorest/exports/Test-AzVMwareLocationTrialAvailability.ps1 @@ -20,16 +20,16 @@ Return trial status for subscription by region .Description Return trial status for subscription by region .Example -Test-AzVMwareLocationTrialAvailability -Location westcentralus +Test-AzVMwareLocationTrialAvailability -Location westcentralus -Name av36 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial .Link https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability #> function Test-AzVMwareLocationTrialAvailability { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial])] -[CmdletBinding(DefaultParameterSetName='Check', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] @@ -44,12 +44,19 @@ param( # The ID of the target subscription. ${SubscriptionId}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The name of the SKU. + ${Name}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -101,7 +108,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -118,13 +125,17 @@ begin { } $mapping = @{ - Check = 'Az.VMware.private\Test-AzVMwareLocationTrialAvailability_Check'; + CheckExpanded = 'Az.VMware.private\Test-AzVMwareLocationTrialAvailability_CheckExpanded'; } - if (('Check') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwareAuthorization.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwareAuthorization.ps1 new file mode 100644 index 000000000000..e57d5816cf5d --- /dev/null +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwareAuthorization.ps1 @@ -0,0 +1,280 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an ExpressRoute Circuit Authorization in a private cloud +.Description +Create an ExpressRoute Circuit Authorization in a private cloud +.Example +Update-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareauthorization +#> +function Update-AzVMwareAuthorization { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('AuthorizationName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the ExpressRoute Circuit Authorization in the private cloud + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the private cloud. + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareAuthorization_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareAuthorization_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwareCloudLink.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwareCloudLink.ps1 new file mode 100644 index 000000000000..e32ea88b756f --- /dev/null +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwareCloudLink.ps1 @@ -0,0 +1,286 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a cloud link in a private cloud +.Description +Create a cloud link in a private cloud +.Example +Update-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecloudlink +#> +function Update-AzVMwareCloudLink { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('CloudLinkName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cloud link resource + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the private cloud. + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Identifier of the other private cloud participating in the link. + ${LinkedCloud}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareCloudLink_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareCloudLink_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwareCluster.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwareCluster.ps1 index e49503b8f225..7cad5117ce83 100644 --- a/src/VMware/VMware.Autorest/exports/Update-AzVMwareCluster.ps1 +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwareCluster.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -R .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecluster #> function Update-AzVMwareCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -100,6 +130,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.Int32] @@ -118,7 +155,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -182,7 +220,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -201,12 +239,17 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwareDatastore.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwareDatastore.ps1 new file mode 100644 index 000000000000..52d7ab7df751 --- /dev/null +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwareDatastore.ps1 @@ -0,0 +1,349 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a datastore in a private cloud cluster +.Description +Create a datastore in a private cloud cluster +.Example +Update-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwaredatastore +#> +function Update-AzVMwareDatastore { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('DatastoreName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the datastore in the private cloud cluster + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Name of the LUN to be used for datastore + ${DiskPoolVolumeLunName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + ${DiskPoolVolumeMountOption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Azure resource ID of the iSCSI target + ${DiskPoolVolumeTargetId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Azure resource ID of the NetApp volume + ${NetAppVolumeId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateViaIdentityClusterExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwareGlobalReachConnection.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwareGlobalReachConnection.ps1 new file mode 100644 index 000000000000..6442195318b7 --- /dev/null +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwareGlobalReachConnection.ps1 @@ -0,0 +1,298 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create a global reach connection in a private cloud +.Description +Create a global reach connection in a private cloud +.Example +Update-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareglobalreachconnection +#> +function Update-AzVMwareGlobalReachConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] + [Alias('GlobalReachConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the global reach connection in the private cloud + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the private cloud. + ${PrivateCloudName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Authorization key from the peer express route used for the global reach connection + ${AuthorizationKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + ${ExpressRouteId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # Identifier of the ExpressRoute Circuit to peer with in the global reach connection + ${PeerExpressRouteCircuit}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.VMware.private\Update-AzVMwareGlobalReachConnection_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareGlobalReachConnection_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.VMware.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwarePlacementPolicy.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwarePlacementPolicy.ps1 index 93c16e529ff3..cbd8ab54a58d 100644 --- a/src/VMware/VMware.Autorest/exports/Update-AzVMwarePlacementPolicy.ps1 +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwarePlacementPolicy.ps1 @@ -27,12 +27,40 @@ Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudNam .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,20 +87,52 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareplacementpolicy #> function Update-AzVMwarePlacementPolicy { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('PlacementPolicyName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -99,6 +159,13 @@ param( # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] @@ -106,6 +173,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # vm-host placement policy affinity strength (should/must) + ${AffinityStrength}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [System.String] + # placement policy azure hybrid benefit opt-in type + ${AzureHybridBenefitType}, + [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] @@ -114,9 +202,9 @@ param( ${HostMember}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState] + [System.String] # Whether the placement policy is enabled or disabled ${State}, @@ -132,7 +220,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -196,7 +285,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -214,13 +303,19 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/exports/Update-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/exports/Update-AzVMwarePrivateCloud.ps1 index 82de46264ff2..97227fbdb68b 100644 --- a/src/VMware/VMware.Autorest/exports/Update-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/exports/Update-AzVMwarePrivateCloud.ps1 @@ -27,7 +27,7 @@ Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_clou .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud .Notes COMPLEX PARAMETER PROPERTIES @@ -42,7 +42,7 @@ IDENTITYSOURCE : vCenter Single Sign On Identity Sources [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. [PrimaryServer ]: Primary server URL [SecondaryServer ]: Secondary server URL - [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group INPUTOBJECT : Identity Parameter @@ -71,11 +71,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareprivatecloud #> function Update-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -107,52 +108,42 @@ param( ${InputObject}, [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [System.Int32] - # The secondary availability zone for the private cloud - ${AvailabilitySecondaryZone}, - - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy])] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy] - # The availability strategy for the private cloud - ${AvailabilityStrategy}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [System.Int32] - # The primary availability zone for the private cloud - ${AvailabilityZone}, + [System.String] + # Status of customer managed encryption key + ${EncryptionStatus}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState])] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState] - # Status of customer managed encryption key - ${EncryptionStatus}, + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] # vCenter Single Sign On Identity Sources # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. ${IdentitySource}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType] + [System.String] # The type of identity used for the private cloud. # The type 'SystemAssigned' refers to an implicitly created identity. # The type 'None' will remove any identities from the Private Cloud. ${IdentityType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, @@ -189,7 +180,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -199,7 +190,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -263,7 +255,7 @@ begin { $parameterSet = $PSCmdlet.ParameterSetName if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { - [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() } $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId if ($preTelemetryId -eq '') { @@ -283,11 +275,15 @@ begin { UpdateExpanded = 'Az.VMware.private\Update-AzVMwarePrivateCloud_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwarePrivateCloud_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } $cmdInfo = Get-Command -Name $mapping[$parameterSet] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){ + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) + } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) diff --git a/src/VMware/VMware.Autorest/generate-help.ps1 b/src/VMware/VMware.Autorest/generate-help.ps1 index e7b8a1104ad1..ddd5cd376165 100644 --- a/src/VMware/VMware.Autorest/generate-help.ps1 +++ b/src/VMware/VMware.Autorest/generate-help.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) +param([switch]$NotIsolated) $ErrorActionPreference = 'Stop' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -66,8 +66,8 @@ foreach($directory in $directories) $docsPath = Join-Path $docsFolder $directory.Name $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue $examplesPath = Join-Path $examplesFolder $directory.Name - - Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + $addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true') + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath -AddComplexInterfaceInfo:$addComplexInterfaceInfo Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" } diff --git a/src/VMware/VMware.Autorest/generate-portal-ux.ps1 b/src/VMware/VMware.Autorest/generate-portal-ux.ps1 new file mode 100644 index 000000000000..7c09a0b2b527 --- /dev/null +++ b/src/VMware/VMware.Autorest/generate-portal-ux.ps1 @@ -0,0 +1,374 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# +# This Script will create a folder dedicated to Azure-specific content and includes metadata files essential for enhancing the user experience (UX) within the Azure portal. +# These files are utilized by the Azure portal to effectively present the usage of cmdlets related to specific resources on portal pages. +# ---------------------------------------------------------------------------------- +param([switch]$NotIsolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $NotIsolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated + return +} + +$moduleName = 'Az.VMware' +$rootModuleName = '' +if ($rootModuleName -eq "") +{ + $rootModuleName = $moduleName +} +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot "./$moduleName.psd1") +$modulePath = $modulePsd1.FullName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot "./bin/$moduleName.private.dll") +$instance = [Microsoft.Azure.PowerShell.Cmdlets.VMware.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName +$parameterSetsInfo = Get-Module -Name "$moduleName.private" + +function Test-FunctionSupported() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + If (-not $FunctionName.Contains("_")) { + return $false + } + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + If ($parameterSetName.Contains("List") -or $parameterSetName.Contains("ViaIdentity") -or $parameterSetName.Contains("ViaJson")) { + return $false + } + If ($cmdletName.StartsWith("New") -or $cmdletName.StartsWith("Set") -or $cmdletName.StartsWith("Update")) { + return $false + } + + $parameterSetInfo = $parameterSetsInfo.ExportedCmdlets[$FunctionName] + foreach ($parameterInfo in $parameterSetInfo.Parameters.Values) + { + $category = (Get-ParameterAttribute -ParameterInfo $parameterInfo -AttributeName "CategoryAttribute").Categories + $invalideCategory = @('Query', 'Body') + if ($invalideCategory -contains $category) + { + return $false + } + } + + $customFiles = Get-ChildItem -Path custom -Filter "$cmdletName.*" + if ($customFiles.Length -ne 0) + { + Write-Host -ForegroundColor Yellow "There are come custom files for $cmdletName, skip generate UX data for it." + return $false + } + + return $true +} + +function Get-MappedCmdletFromFunctionName() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [string] + $FunctionName + ) + + $cmdletName, $parameterSetName = $FunctionName.Split("_") + + return $cmdletName +} + +function Get-ParameterAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo, + [Parameter()] + [String] + $AttributeName + ) + return $ParameterInfo.Attributes | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletAttribute() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $CmdletInfo, + [Parameter()] + [String] + $AttributeName + ) + + return $CmdletInfo.ImplementingType.GetTypeInfo().GetCustomAttributes([System.object], $true) | Where-Object { $_.TypeId.Name -eq $AttributeName } +} + +function Get-CmdletDescription() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [String] + $CmdletName + ) + $helpInfo = Get-Help $CmdletName -Full + + $description = $helpInfo.Description.Text + if ($null -eq $description) + { + return "" + } + return $description +} + +# Test whether the parameter is from swagger http path +function Test-ParameterFromSwagger() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.ParameterMetadata] + $ParameterInfo + ) + $category = (Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "CategoryAttribute").Categories + $doNotExport = Get-ParameterAttribute -ParameterInfo $ParameterInfo -AttributeName "DoNotExportAttribute" + if ($null -ne $doNotExport) + { + return $false + } + + $valideCategory = @('Path') + if ($valideCategory -contains $category) + { + return $true + } + return $false +} + +function New-ExampleForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $category = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "CategoryAttribute").Categories + $sourceName = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "InfoAttribute").SerializedName + $name = $parameter.Name + $result += [ordered]@{ + name = "-$Name" + value = "[$category.$sourceName]" + } + } + + return $result +} + +function New-ParameterArrayInParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $parameters = $ParameterSetInfo.Parameters.Values | Where-Object { Test-ParameterFromSwagger $_ } + $result = @() + foreach ($parameter in $parameters) + { + $isMandatory = (Get-ParameterAttribute -parameterInfo $parameter -AttributeName "ParameterAttribute").Mandatory + $parameterName = $parameter.Name + $parameterType = $parameter.ParameterType.ToString().Split('.')[1] + if ($parameter.SwitchParameter) + { + $parameterSignature = "-$parameterName" + } + else + { + $parameterSignature = "-$parameterName <$parameterType>" + } + if ($parameterName -eq "SubscriptionId") + { + $isMandatory = $false + } + if (-not $isMandatory) + { + $parameterSignature = "[$parameterSignature]" + } + $result += $parameterSignature + } + + return $result +} + +function New-MetadataForParameterSet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Management.Automation.CommandInfo] + $ParameterSetInfo + ) + $httpAttribute = Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "HttpPathAttribute" + $httpPath = $httpAttribute.Path + $apiVersion = $httpAttribute.ApiVersion + $provider = [System.Text.RegularExpressions.Regex]::New("/providers/([\w+\.]+)/").Match($httpPath).Groups[1].Value + $resourcePath = "/" + $httpPath.Split("$provider/")[1] + $resourceType = [System.Text.RegularExpressions.Regex]::New("/([\w]+)/\{\w+\}").Matches($resourcePath) | ForEach-Object {$_.groups[1].Value} | Join-String -Separator "/" + $cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name + $description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description + [object[]]$example = New-ExampleForParameterSet $ParameterSetInfo + [string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo + + return @{ + Path = $httpPath + Provider = $provider + ResourceType = $resourceType + ApiVersion = $apiVersion + CmdletName = $cmdletName + Description = $description + Example = $example + Signature = @{ + parameters = $signature + } + } +} + +function Merge-WithExistCmdletMetadata() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [System.Collections.Specialized.OrderedDictionary] + $ExistedCmdletInfo, + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $ExistedCmdletInfo.help.parameterSets += $ParameterSetMetadata.Signature + $ExistedCmdletInfo.examples += [ordered]@{ + description = $ParameterSetMetadata.Description + parameters = $ParameterSetMetadata.Example + } + + return $ExistedCmdletInfo +} + +function New-MetadataForCmdlet() +{ + [CmdletBinding()] + Param ( + [Parameter()] + [Hashtable] + $ParameterSetMetadata + ) + $cmdletName = $ParameterSetMetadata.CmdletName + $description = Get-CmdletDescription $cmdletName + $result = [ordered]@{ + name = $cmdletName + description = $description + path = $ParameterSetMetadata.Path + help = [ordered]@{ + learnMore = [ordered]@{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName/$cmdletName".ToLower() + } + parameterSets = @() + } + examples = @() + } + $result = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $result -ParameterSetMetadata $ParameterSetMetadata + return $result +} + +$parameterSets = $parameterSetsInfo.ExportedCmdlets.Keys | Where-Object { Test-FunctionSupported($_) } +$resourceTypes = @{} +foreach ($parameterSetName in $parameterSets) +{ + $cmdletInfo = $parameterSetsInfo.ExportedCommands[$parameterSetName] + $parameterSetMetadata = New-MetadataForParameterSet -ParameterSetInfo $cmdletInfo + $cmdletName = $parameterSetMetadata.CmdletName + if (-not ($moduleInfo.ExportedCommands.ContainsKey($cmdletName))) + { + continue + } + if ($resourceTypes.ContainsKey($parameterSetMetadata.ResourceType)) + { + $ExistedCmdletInfo = $resourceTypes[$parameterSetMetadata.ResourceType].commands | Where-Object { $_.name -eq $cmdletName } + if ($ExistedCmdletInfo) + { + $ExistedCmdletInfo = Merge-WithExistCmdletMetadata -ExistedCmdletInfo $ExistedCmdletInfo -ParameterSetMetadata $parameterSetMetadata + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType].commands += $cmdletInfo + } + } + else + { + $cmdletInfo = New-MetadataForCmdlet -ParameterSetMetadata $parameterSetMetadata + $resourceTypes[$parameterSetMetadata.ResourceType] = [ordered]@{ + resourceType = $parameterSetMetadata.ResourceType + apiVersion = $parameterSetMetadata.ApiVersion + learnMore = @{ + url = "https://learn.microsoft.com/powershell/module/$rootModuleName".ToLower() + } + commands = @($cmdletInfo) + provider = $parameterSetMetadata.Provider + } + } +} + +$UXFolder = 'UX' +if (Test-Path $UXFolder) +{ + Remove-Item -Path $UXFolder -Recurse +} +$null = New-Item -ItemType Directory -Path $UXFolder + +foreach ($resourceType in $resourceTypes.Keys) +{ + $resourceTypeFileName = $resourceType -replace "/", "-" + if ($resourceTypeFileName -eq "") + { + continue + } + $resourceTypeInfo = $resourceTypes[$resourceType] + $provider = $resourceTypeInfo.provider + $providerFolder = "$UXFolder/$provider" + if (-not (Test-Path $providerFolder)) + { + $null = New-Item -ItemType Directory -Path $providerFolder + } + $resourceTypeInfo.Remove("provider") + $resourceTypeInfo | ConvertTo-Json -Depth 10 | Out-File "$providerFolder/$resourceTypeFileName.json" +} diff --git a/src/VMware/VMware.Autorest/generated/Module.cs b/src/VMware/VMware.Autorest/generated/Module.cs index c2e94bfa8a59..c11300822a85 100644 --- a/src/VMware/VMware.Autorest/generated/Module.cs +++ b/src/VMware/VMware.Autorest/generated/Module.cs @@ -26,12 +26,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.VMware.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.VMware.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(); @@ -51,11 +59,8 @@ public partial class Module /// The delegate to get the telemetry Id. public GetTelemetryIdDelegate GetTelemetryId { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.VMware.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware"; @@ -117,9 +122,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline CreatePipe /// 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/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Addon.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Addon.PowerShell.cs index 1a384d630067..7eb1e64c95f2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Addon.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Addon partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal Addon(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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. @@ -111,45 +111,45 @@ internal Addon(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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.VMware.Models.Api20211201.IAddon DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Addon(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.VMware.Models.Api20211201.IAddon DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Addon(content); } @@ -159,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Addon.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Addon.TypeConverter.cs index 4cae502e2514..a00286912f29 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Addon.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddon ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.cs b/src/VMware/VMware.Autorest/generated/api/Models/Addon.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Addon.cs index 13a5e3801c7b..a1fbd7ee2a1c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Addon.cs @@ -3,45 +3,44 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An addon resource public partial class Addon : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties _property; /// The properties of an addon resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -49,7 +48,7 @@ public partial class Addon : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public Addon() @@ -72,24 +71,27 @@ public Addon() /// An addon resource public partial interface IAddon : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// The properties of an addon resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The properties of an addon resource", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties Property { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Property { get; set; } } /// An addon resource internal partial interface IAddonInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// The properties of an addon resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Property { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Addon.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Addon.json.cs index 9cb08e4c1c91..35d51d8e5dba 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Addon.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Addon.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal Addon(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Addon(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.PowerShell.cs new file mode 100644 index 000000000000..1cb4368dbaec --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.PowerShell.cs @@ -0,0 +1,180 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// The properties of an Arc addon + [System.ComponentModel.TypeConverter(typeof(AddonArcPropertiesTypeConverter))] + public partial class AddonArcProperties + { + + /// + /// 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 a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AddonArcProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcPropertiesInternal)this).VCenter = (string) content.GetValueForProperty("VCenter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcPropertiesInternal)this).VCenter, global::System.Convert.ToString); + } + if (content.Contains("AddonType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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 AddonArcProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VCenter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcPropertiesInternal)this).VCenter = (string) content.GetValueForProperty("VCenter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcPropertiesInternal)this).VCenter, global::System.Convert.ToString); + } + if (content.Contains("AddonType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// 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.VMware.Models.IAddonArcProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AddonArcProperties(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.VMware.Models.IAddonArcProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AddonArcProperties(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.VMware.Models.IAddonArcProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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(); + } + } + /// The properties of an Arc addon + [System.ComponentModel.TypeConverter(typeof(AddonArcPropertiesTypeConverter))] + public partial interface IAddonArcProperties + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.TypeConverter.cs new file mode 100644 index 000000000000..46aab8aaae66 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AddonArcPropertiesTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AddonArcProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AddonArcProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AddonArcProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.cs new file mode 100644 index 000000000000..cb2ed488c52a --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.cs @@ -0,0 +1,84 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// The properties of an Arc addon + public partial class AddonArcProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(); + + /// The type of private cloud addon + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string AddonType { get => "Arc"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).AddonType = "Arc"; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } + + /// The state of the addon provisioning + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } + + /// Backing field for property. + private string _vCenter; + + /// The VMware vCenter resource ID + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string VCenter { get => this._vCenter; set => this._vCenter = value; } + + /// Creates an new instance. + public AddonArcProperties() + { + this.__addonProperties.AddonType = "Arc"; + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__addonProperties), __addonProperties); + await eventListener.AssertObjectIsValid(nameof(__addonProperties), __addonProperties); + } + } + /// The properties of an Arc addon + public partial interface IAddonArcProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties + { + /// The VMware vCenter resource ID + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The VMware vCenter resource ID", + SerializedName = @"vCenter", + PossibleTypes = new [] { typeof(string) })] + string VCenter { get; set; } + + } + /// The properties of an Arc addon + internal partial interface IAddonArcPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal + { + /// The VMware vCenter resource ID + string VCenter { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.json.cs new file mode 100644 index 000000000000..d2865037d69d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonArcProperties.json.cs @@ -0,0 +1,110 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// The properties of an Arc addon + public partial class AddonArcProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. + internal AddonArcProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(json); + {_vCenter = If( json?.PropertyT("vCenter"), out var __jsonVCenter) ? (string)__jsonVCenter : (string)_vCenter;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonArcProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AddonArcProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __addonProperties?.ToJson(container, serializationMode); + AddIf( null != (((object)this._vCenter)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vCenter.ToString()) : null, "vCenter" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.PowerShell.cs index 2fbf12ad6ff5..5049d79b8379 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AddonHcxProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal AddonHcxProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Offer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxPropertiesInternal)this).Offer = (string) content.GetValueForProperty("Offer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxPropertiesInternal)this).Offer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxPropertiesInternal)this).Offer = (string) content.GetValueForProperty("Offer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxPropertiesInternal)this).Offer, global::System.Convert.ToString); } if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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. @@ -107,41 +107,41 @@ internal AddonHcxProperties(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Offer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxPropertiesInternal)this).Offer = (string) content.GetValueForProperty("Offer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxPropertiesInternal)this).Offer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxPropertiesInternal)this).Offer = (string) content.GetValueForProperty("Offer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxPropertiesInternal)this).Offer, global::System.Convert.ToString); } if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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.VMware.Models.Api20211201.IAddonHcxProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AddonHcxProperties(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.VMware.Models.Api20211201.IAddonHcxProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AddonHcxProperties(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.TypeConverter.cs index 4b7741ba19fe..13e18fa1a695 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddonHcxProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.cs index 1a60e7bc8afc..583e6be6eca4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.cs @@ -3,28 +3,28 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of an HCX addon public partial class AddonHcxProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(); /// The type of private cloud addon + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType AddonType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).AddonType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).AddonType = value ; } + public string AddonType { get => "HCX"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).AddonType = "HCX"; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } /// Backing field for property. private string _offer; @@ -35,12 +35,12 @@ public partial class AddonHcxProperties : /// The state of the addon provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } /// Creates an new instance. public AddonHcxProperties() { - + this.__addonProperties.AddonType = "HCX"; } /// Validates that this object meets the validation criteria. @@ -58,12 +58,15 @@ public AddonHcxProperties() /// The properties of an HCX addon public partial interface IAddonHcxProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties { /// The HCX offer, example VMware MaaS Cloud Provider (Enterprise) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The HCX offer, example VMware MaaS Cloud Provider (Enterprise)", SerializedName = @"offer", PossibleTypes = new [] { typeof(string) })] @@ -72,7 +75,7 @@ public partial interface IAddonHcxProperties : } /// The properties of an HCX addon internal partial interface IAddonHcxPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal { /// The HCX offer, example VMware MaaS Cloud Provider (Enterprise) string Offer { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.json.cs index 0f58962c301d..902973f8dd85 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonHcxProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonHcxProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AddonHcxProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Js { return; } - __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties(json); - {_offer = If( json?.PropertyT("offer"), out var __jsonOffer) ? (string)__jsonOffer : (string)Offer;} + __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(json); + {_offer = If( json?.PropertyT("offer"), out var __jsonOffer) ? (string)__jsonOffer : (string)_offer;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonHcxProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonHcxProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AddonHcxProperties(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonList.PowerShell.cs index b49a3cf0b84d..f5214b947c29 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AddonList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal AddonList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).NextLink, 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. @@ -103,37 +103,37 @@ internal AddonList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal)this).NextLink, 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.VMware.Models.Api20211201.IAddonList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AddonList(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.VMware.Models.Api20211201.IAddonList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AddonList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonList.TypeConverter.cs index a4d6bfbb8302..7085813df12d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddonList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonList.cs index 877c3af5b140..59d3e49c43ed 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of addons public partial class AddonList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class AddonList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public AddonList() @@ -47,6 +47,9 @@ public partial interface IAddonList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IAddonList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon) })] + System.Collections.Generic.List Value { get; } } /// A paged list of addons @@ -68,7 +74,7 @@ internal partial interface IAddonListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonList.json.cs index d8f52a2ed0d4..dad333419b47 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal AddonList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonOb { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddon) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Addon.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.VMware.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.VMware.Models.IAddon) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AddonList(json) : null; } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.PowerShell.cs index 9b44a5596f6e..793a196cda89 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AddonProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal AddonProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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. @@ -103,37 +103,37 @@ internal AddonProperties(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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.VMware.Models.Api20211201.IAddonProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AddonProperties(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.VMware.Models.Api20211201.IAddonProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AddonProperties(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.TypeConverter.cs index 22f18e04b66b..a16cb662288d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddonProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.cs similarity index 57% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.cs index 40f9e22e6817..82525c503263 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.cs @@ -3,32 +3,32 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of an addon public partial class AddonProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType _addonType; + private string _addonType; /// The type of private cloud addon [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType AddonType { get => this._addonType; set => this._addonType = value; } + public string AddonType { get => this._addonType; set => this._addonType = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? _provisioningState; + private string _provisioningState; /// The state of the addon provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public AddonProperties() @@ -44,18 +44,26 @@ public partial interface IAddonProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of private cloud addon", SerializedName = @"addonType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType AddonType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SRM", "VR", "HCX", "Arc")] + string AddonType { get; set; } /// The state of the addon provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the addon provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } } /// The properties of an addon @@ -63,9 +71,11 @@ internal partial interface IAddonPropertiesInternal { /// The type of private cloud addon - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType AddonType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SRM", "VR", "HCX", "Arc")] + string AddonType { get; set; } /// The state of the addon provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.json.cs index 1cbe3a51c1ac..1a94ec4b6b33 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,21 @@ internal AddonProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json. { return; } - {_addonType = If( json?.PropertyT("addonType"), out var __jsonAddonType) ? (string)__jsonAddonType : (string)AddonType;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_addonType = If( json?.PropertyT("addonType"), out var __jsonAddonType) ? (string)__jsonAddonType : (string)_addonType;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties interface is polymorphic, and - /// the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties interface is polymorphic, and the precise + /// model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json)) { @@ -101,6 +101,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo { return new AddonHcxProperties(json); } + case "Arc": + { + return new AddonArcProperties(json); + } } return new AddonProperties(json); } @@ -125,7 +129,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } AddIf( null != (((object)this._addonType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._addonType.ToString()) : null, "addonType" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.PowerShell.cs similarity index 74% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.PowerShell.cs index 67689215252e..67eb7eb18543 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AddonSrmProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal AddonSrmProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("LicenseKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmPropertiesInternal)this).LicenseKey = (string) content.GetValueForProperty("LicenseKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmPropertiesInternal)this).LicenseKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmPropertiesInternal)this).LicenseKey = (string) content.GetValueForProperty("LicenseKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmPropertiesInternal)this).LicenseKey, global::System.Convert.ToString); } if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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. @@ -107,41 +107,41 @@ internal AddonSrmProperties(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("LicenseKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmPropertiesInternal)this).LicenseKey = (string) content.GetValueForProperty("LicenseKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmPropertiesInternal)this).LicenseKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmPropertiesInternal)this).LicenseKey = (string) content.GetValueForProperty("LicenseKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmPropertiesInternal)this).LicenseKey, global::System.Convert.ToString); } if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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.VMware.Models.Api20211201.IAddonSrmProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AddonSrmProperties(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.VMware.Models.Api20211201.IAddonSrmProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AddonSrmProperties(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.TypeConverter.cs index 89cb3d1f019f..f3ffd754b064 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddonSrmProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.cs index 630b03a3af56..ae47d68bb4c5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.cs @@ -3,25 +3,25 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a Site Recovery Manager (SRM) addon public partial class AddonSrmProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(); /// The type of private cloud addon + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType AddonType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).AddonType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).AddonType = value ; } + public string AddonType { get => "SRM"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).AddonType = "SRM"; } /// Backing field for property. private string _licenseKey; @@ -31,16 +31,16 @@ public partial class AddonSrmProperties : public string LicenseKey { get => this._licenseKey; set => this._licenseKey = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } /// The state of the addon provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } /// Creates an new instance. public AddonSrmProperties() { - + this.__addonProperties.AddonType = "SRM"; } /// Validates that this object meets the validation criteria. @@ -58,12 +58,15 @@ public AddonSrmProperties() /// The properties of a Site Recovery Manager (SRM) addon public partial interface IAddonSrmProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties { /// The Site Recovery Manager (SRM) license [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Site Recovery Manager (SRM) license", SerializedName = @"licenseKey", PossibleTypes = new [] { typeof(string) })] @@ -72,7 +75,7 @@ public partial interface IAddonSrmProperties : } /// The properties of a Site Recovery Manager (SRM) addon internal partial interface IAddonSrmPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal { /// The Site Recovery Manager (SRM) license string LicenseKey { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.json.cs index 99c492e9dab6..0cb84065b9e8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonSrmProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonSrmProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AddonSrmProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Js { return; } - __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties(json); - {_licenseKey = If( json?.PropertyT("licenseKey"), out var __jsonLicenseKey) ? (string)__jsonLicenseKey : (string)LicenseKey;} + __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(json); + {_licenseKey = If( json?.PropertyT("licenseKey"), out var __jsonLicenseKey) ? (string)__jsonLicenseKey : (string)_licenseKey;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonSrmProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonSrmProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AddonSrmProperties(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.PowerShell.cs similarity index 74% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.PowerShell.cs index de2c28e8fc5a..27473eb2566e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AddonVrProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal AddonVrProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("VrsCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrPropertiesInternal)this).VrsCount = (int) content.GetValueForProperty("VrsCount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrPropertiesInternal)this).VrsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrPropertiesInternal)this).VrsCount = (int) content.GetValueForProperty("VrsCount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrPropertiesInternal)this).VrsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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. @@ -107,41 +107,41 @@ internal AddonVrProperties(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("VrsCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrPropertiesInternal)this).VrsCount = (int) content.GetValueForProperty("VrsCount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrPropertiesInternal)this).VrsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrPropertiesInternal)this).VrsCount = (int) content.GetValueForProperty("VrsCount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrPropertiesInternal)this).VrsCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("AddonType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).AddonType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType = (string) content.GetValueForProperty("AddonType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).AddonType, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)this).ProvisioningState, 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.VMware.Models.Api20211201.IAddonVrProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AddonVrProperties(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.VMware.Models.Api20211201.IAddonVrProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AddonVrProperties(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.TypeConverter.cs index 9d2ce87e6732..ff430b0d1ba6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddonVrProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.cs index 7f6d85a52bfc..2b102d2f3a0b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.cs @@ -3,32 +3,32 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a vSphere Replication (VR) addon public partial class AddonVrProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(); /// The type of private cloud addon + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType AddonType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).AddonType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).AddonType = value ; } + public string AddonType { get => "VR"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).AddonType = "VR"; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState = value; } /// The state of the addon provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal)__addonProperties).ProvisioningState; } /// Backing field for property. private int _vrsCount; @@ -40,7 +40,7 @@ public partial class AddonVrProperties : /// Creates an new instance. public AddonVrProperties() { - + this.__addonProperties.AddonType = "VR"; } /// Validates that this object meets the validation criteria. @@ -58,12 +58,15 @@ public AddonVrProperties() /// The properties of a vSphere Replication (VR) addon public partial interface IAddonVrProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties { /// The vSphere Replication Server (VRS) count [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The vSphere Replication Server (VRS) count", SerializedName = @"vrsCount", PossibleTypes = new [] { typeof(int) })] @@ -72,7 +75,7 @@ public partial interface IAddonVrProperties : } /// The properties of a vSphere Replication (VR) addon internal partial interface IAddonVrPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonPropertiesInternal { /// The vSphere Replication Server (VRS) count int VrsCount { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.json.cs index 4e13d92bdd36..e022bdc16dc9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AddonVrProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AddonVrProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AddonVrProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Jso { return; } - __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonProperties(json); - {_vrsCount = If( json?.PropertyT("vrsCount"), out var __jsonVrsCount) ? (int)__jsonVrsCount : VrsCount;} + __addonProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonProperties(json); + {_vrsCount = If( json?.PropertyT("vrsCount"), out var __jsonVrsCount) ? (int)__jsonVrsCount : _vrsCount;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonVrProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonVrProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AddonVrProperties(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.PowerShell.cs similarity index 73% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.PowerShell.cs index 1d72c6a6f382..c6a2edaef669 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AdminCredentials partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal AdminCredentials(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NsxtUsername")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtUsername = (string) content.GetValueForProperty("NsxtUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtUsername, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtUsername = (string) content.GetValueForProperty("NsxtUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtUsername, global::System.Convert.ToString); } if (content.Contains("NsxtPassword")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtPassword = (System.Security.SecureString) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtPassword, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtPassword = (System.Security.SecureString) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtPassword, (object ss) => (System.Security.SecureString)ss); } if (content.Contains("VcenterUsername")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterUsername = (string) content.GetValueForProperty("VcenterUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterUsername, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterUsername = (string) content.GetValueForProperty("VcenterUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterUsername, global::System.Convert.ToString); } if (content.Contains("VcenterPassword")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterPassword = (System.Security.SecureString) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterPassword, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterPassword = (System.Security.SecureString) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterPassword, (object ss) => (System.Security.SecureString)ss); } 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. @@ -111,45 +111,45 @@ internal AdminCredentials(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NsxtUsername")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtUsername = (string) content.GetValueForProperty("NsxtUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtUsername, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtUsername = (string) content.GetValueForProperty("NsxtUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtUsername, global::System.Convert.ToString); } if (content.Contains("NsxtPassword")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtPassword = (System.Security.SecureString) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).NsxtPassword, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtPassword = (System.Security.SecureString) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).NsxtPassword, (object ss) => (System.Security.SecureString)ss); } if (content.Contains("VcenterUsername")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterUsername = (string) content.GetValueForProperty("VcenterUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterUsername, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterUsername = (string) content.GetValueForProperty("VcenterUsername",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterUsername, global::System.Convert.ToString); } if (content.Contains("VcenterPassword")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterPassword = (System.Security.SecureString) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal)this).VcenterPassword, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterPassword = (System.Security.SecureString) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal)this).VcenterPassword, (object ss) => (System.Security.SecureString)ss); } 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.VMware.Models.Api20211201.IAdminCredentials DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AdminCredentials(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.VMware.Models.Api20211201.IAdminCredentials DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AdminCredentials(content); } @@ -159,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdmi /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.TypeConverter.cs index 44666089c36c..7bcdba454dc8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAdminCredentials ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.cs b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.cs similarity index 83% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.cs index fc577475c5bf..630a6f19862c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.cs @@ -3,27 +3,27 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Administrative credentials for accessing vCenter and NSX-T public partial class AdminCredentials : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal { /// Internal Acessors for NsxtPassword - System.Security.SecureString Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal.NsxtPassword { get => this._nsxtPassword; set { {_nsxtPassword = value;} } } + System.Security.SecureString Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal.NsxtPassword { get => this._nsxtPassword; set { {_nsxtPassword = value;} } } /// Internal Acessors for NsxtUsername - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal.NsxtUsername { get => this._nsxtUsername; set { {_nsxtUsername = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal.NsxtUsername { get => this._nsxtUsername; set { {_nsxtUsername = value;} } } /// Internal Acessors for VcenterPassword - System.Security.SecureString Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal.VcenterPassword { get => this._vcenterPassword; set { {_vcenterPassword = value;} } } + System.Security.SecureString Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal.VcenterPassword { get => this._vcenterPassword; set { {_vcenterPassword = value;} } } /// Internal Acessors for VcenterUsername - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentialsInternal.VcenterUsername { get => this._vcenterUsername; set { {_vcenterUsername = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentialsInternal.VcenterUsername { get => this._vcenterUsername; set { {_vcenterUsername = value;} } } /// Backing field for property. private System.Security.SecureString _nsxtPassword; @@ -67,6 +67,9 @@ public partial interface IAdminCredentials : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"NSX-T Manager password", SerializedName = @"nsxtPassword", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -75,6 +78,9 @@ public partial interface IAdminCredentials : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"NSX-T Manager username", SerializedName = @"nsxtUsername", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IAdminCredentials : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"vCenter admin password", SerializedName = @"vcenterPassword", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -91,6 +100,9 @@ public partial interface IAdminCredentials : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"vCenter admin username", SerializedName = @"vcenterUsername", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.json.cs index b3464ea8666a..58fba9975923 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AdminCredentials.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AdminCredentials.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,21 @@ internal AdminCredentials(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json { return; } - {_nsxtUsername = If( json?.PropertyT("nsxtUsername"), out var __jsonNsxtUsername) ? (string)__jsonNsxtUsername : (string)NsxtUsername;} - {_nsxtPassword = If( json?.PropertyT("nsxtPassword"), out var __jsonNsxtPassword) ? new System.Net.NetworkCredential("",(string)__jsonNsxtPassword).SecurePassword : NsxtPassword;} - {_vcenterUsername = If( json?.PropertyT("vcenterUsername"), out var __jsonVcenterUsername) ? (string)__jsonVcenterUsername : (string)VcenterUsername;} - {_vcenterPassword = If( json?.PropertyT("vcenterPassword"), out var __jsonVcenterPassword) ? new System.Net.NetworkCredential("",(string)__jsonVcenterPassword).SecurePassword : VcenterPassword;} + {_nsxtUsername = If( json?.PropertyT("nsxtUsername"), out var __jsonNsxtUsername) ? (string)__jsonNsxtUsername : (string)_nsxtUsername;} + {_nsxtPassword = If( json?.PropertyT("nsxtPassword"), out var __jsonNsxtPassword) ? new System.Net.NetworkCredential("",(string)__jsonNsxtPassword).SecurePassword : _nsxtPassword;} + {_vcenterUsername = If( json?.PropertyT("vcenterUsername"), out var __jsonVcenterUsername) ? (string)__jsonVcenterUsername : (string)_vcenterUsername;} + {_vcenterPassword = If( json?.PropertyT("vcenterPassword"), out var __jsonVcenterPassword) ? new System.Net.NetworkCredential("",(string)__jsonVcenterPassword).SecurePassword : _vcenterPassword;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AdminCredentials(json) : null; } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nsxtUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nsxtUsername.ToString()) : null, "nsxtUsername" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nsxtPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._nsxtPassword))) : null, "nsxtPassword" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vcenterUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vcenterUsername.ToString()) : null, "vcenterUsername" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vcenterPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(System.Runtime.InteropServices.Marshal.PtrToStringBSTR(System.Runtime.InteropServices.Marshal.SecureStringToBSTR(this._vcenterPassword))) : null, "vcenterPassword" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Any.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Any.PowerShell.cs index 0004b177eeb8..e769b2d4eacf 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -146,7 +146,7 @@ public override string ToString() return ToJsonString(); } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Any.cs b/src/VMware/VMware.Autorest/generated/api/Models/Any.cs index 3e49bcc308bf..3bd341fafc4b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Any.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Any.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Any.json.cs index 499faf3927f9..3e7d043e4a12 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Any.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.PowerShell.cs deleted file mode 100644 index 6d011930eccd..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.PowerShell.cs +++ /dev/null @@ -1,204 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// API error response - [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] - public partial class CloudError - { - - /// - /// 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 a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal CloudError(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponseTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CloudError(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponseTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// 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.VMware.Models.Api20211201.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CloudError(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.VMware.Models.Api20211201.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CloudError(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.VMware.Models.Api20211201.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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(); - } - } - /// API error response - [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] - public partial interface ICloudError - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.cs deleted file mode 100644 index 9b1e105d895a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.cs +++ /dev/null @@ -1,131 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// API error response - public partial class CloudError : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudError, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal - { - - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).AdditionalInfo; } - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Code; } - - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Detail; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse _error; - - /// An error returned by the API - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponse()); set => this._error = value; } - - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Message; } - - /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).AdditionalInfo = value; } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Code = value; } - - /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Detail = value; } - - /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponse()); set { {_error = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Message = value; } - - /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudErrorInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Target = value; } - - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)Error).Target; } - - /// Creates an new instance. - public CloudError() - { - - } - } - /// API error response - public partial interface ICloudError : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable - { - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error additional info.", - SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error details.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Detail { get; } - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error message.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error target.", - SerializedName = @"target", - PossibleTypes = new [] { typeof(string) })] - string Target { get; } - - } - /// API error response - internal partial interface ICloudErrorInternal - - { - /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; set; } - /// The error code. - string Code { get; set; } - /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Detail { get; set; } - /// An error returned by the API - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse Error { get; set; } - /// The error message. - string Message { get; set; } - /// The error target. - string Target { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.cs deleted file mode 100644 index 073ee44a4558..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.cs +++ /dev/null @@ -1,139 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// The properties of customer managed encryption key - public partial class Encryption : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties _keyVaultProperty; - - /// The key vault where the encryption key is stored - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultProperties()); set => this._keyVaultProperty = value; } - - /// The name of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyName = value ?? null; } - - /// The state of key provided - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyState; } - - /// The URL of the vault. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUrl = value ?? null; } - - /// The version of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion = value ?? null; } - - /// Property of the key if user provided or auto detected - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).VersionType; } - - /// Internal Acessors for KeyVaultProperty - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal.KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultProperties()); set { {_keyVaultProperty = value;} } } - - /// Internal Acessors for KeyVaultPropertyKeyState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyState = value; } - - /// Internal Acessors for KeyVaultPropertyVersionType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).VersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).VersionType = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? _status; - - /// Status of customer managed encryption key - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? Status { get => this._status; set => this._status = value; } - - /// Creates an new instance. - public Encryption() - { - - } - } - /// The properties of customer managed encryption key - public partial interface IEncryption : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable - { - /// The name of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name of the key.", - SerializedName = @"keyName", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyName { get; set; } - /// The state of key provided - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The state of key provided", - SerializedName = @"keyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; } - /// The URL of the vault. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the vault.", - SerializedName = @"keyVaultUrl", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyVaultUrl { get; set; } - /// The version of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The version of the key.", - SerializedName = @"keyVersion", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyVersion { get; set; } - /// Property of the key if user provided or auto detected - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Property of the key if user provided or auto detected", - SerializedName = @"versionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; } - /// Status of customer managed encryption key - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Status of customer managed encryption key", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? Status { get; set; } - - } - /// The properties of customer managed encryption key - internal partial interface IEncryptionInternal - - { - /// The key vault where the encryption key is stored - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties KeyVaultProperty { get; set; } - /// The name of the key. - string KeyVaultPropertyKeyName { get; set; } - /// The state of key provided - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; set; } - /// The URL of the vault. - string KeyVaultPropertyKeyVaultUrl { get; set; } - /// The version of the key. - string KeyVaultPropertyKeyVersion { get; set; } - /// Property of the key if user provided or auto detected - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; set; } - /// Status of customer managed encryption key - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? Status { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.cs deleted file mode 100644 index 86edcf74cc0b..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.cs +++ /dev/null @@ -1,88 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// An update of a DRS placement policy resource - public partial class PlacementPolicyUpdate : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal - { - - /// Host members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] HostMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)Property).HostMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)Property).HostMember = value ?? null /* arrayOf */; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdateProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties _property; - - /// The properties of a placement policy resource that may be updated - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdateProperties()); set => this._property = value; } - - /// Whether the placement policy is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState)""); } - - /// Virtual machine members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] VMMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)Property).VMMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)Property).VMMember = value ?? null /* arrayOf */; } - - /// Creates an new instance. - public PlacementPolicyUpdate() - { - - } - } - /// An update of a DRS placement policy resource - public partial interface IPlacementPolicyUpdate : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable - { - /// Host members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Host members list", - SerializedName = @"hostMembers", - PossibleTypes = new [] { typeof(string) })] - string[] HostMember { get; set; } - /// Whether the placement policy is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Whether the placement policy is enabled or disabled", - SerializedName = @"state", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get; set; } - /// Virtual machine members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Virtual machine members list", - SerializedName = @"vmMembers", - PossibleTypes = new [] { typeof(string) })] - string[] VMMember { get; set; } - - } - /// An update of a DRS placement policy resource - internal partial interface IPlacementPolicyUpdateInternal - - { - /// Host members list - string[] HostMember { get; set; } - /// The properties of a placement policy resource that may be updated - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties Property { get; set; } - /// Whether the placement policy is enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get; set; } - /// Virtual machine members list - string[] VMMember { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.cs deleted file mode 100644 index b142419c0cd1..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.cs +++ /dev/null @@ -1,85 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// The properties of a placement policy resource that may be updated - public partial class PlacementPolicyUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal - { - - /// Backing field for property. - private string[] _hostMember; - - /// Host members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] HostMember { get => this._hostMember; set => this._hostMember = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? _state; - - /// Whether the placement policy is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get => this._state; set => this._state = value; } - - /// Backing field for property. - private string[] _vMMember; - - /// Virtual machine members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] VMMember { get => this._vMMember; set => this._vMMember = value; } - - /// Creates an new instance. - public PlacementPolicyUpdateProperties() - { - - } - } - /// The properties of a placement policy resource that may be updated - public partial interface IPlacementPolicyUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable - { - /// Host members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Host members list", - SerializedName = @"hostMembers", - PossibleTypes = new [] { typeof(string) })] - string[] HostMember { get; set; } - /// Whether the placement policy is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Whether the placement policy is enabled or disabled", - SerializedName = @"state", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get; set; } - /// Virtual machine members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Virtual machine members list", - SerializedName = @"vmMembers", - PossibleTypes = new [] { typeof(string) })] - string[] VMMember { get; set; } - - } - /// The properties of a placement policy resource that may be updated - internal partial interface IPlacementPolicyUpdatePropertiesInternal - - { - /// Host members list - string[] HostMember { get; set; } - /// Whether the placement policy is enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get; set; } - /// Virtual machine members list - string[] VMMember { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.PowerShell.cs deleted file mode 100644 index 7becde27641b..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.PowerShell.cs +++ /dev/null @@ -1,596 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// A private cloud resource - [System.ComponentModel.TypeConverter(typeof(PrivateCloudTypeConverter))] - public partial class PrivateCloud - { - - /// - /// 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.VMware.Models.Api20211201.IPrivateCloud DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PrivateCloud(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.VMware.Models.Api20211201.IPrivateCloud DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PrivateCloud(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.VMware.Models.Api20211201.IPrivateCloud FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PrivateCloud(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("Circuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EndpointsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("SecondaryCircuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState.CreateFrom); - } - if (content.Contains("NetworkBlock")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NetworkBlock, global::System.Convert.ToString); - } - if (content.Contains("ManagementNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementNetwork, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningNetwork, global::System.Convert.ToString); - } - if (content.Contains("VmotionNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VmotionNetwork, global::System.Convert.ToString); - } - if (content.Contains("VcenterPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterPassword, global::System.Convert.ToString); - } - if (content.Contains("NsxtPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtPassword, global::System.Convert.ToString); - } - if (content.Contains("VcenterCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("NsxtCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("ExternalCloudLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ExternalCloudLink = (string[]) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("CircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("EndpointNsxtManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointNsxtManager, global::System.Convert.ToString); - } - if (content.Contains("EndpointVcsa")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointVcsa, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); - } - if (content.Contains("EndpointHcxCloudManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PrivateCloud(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Sku")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.SkuTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("SkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SkuName, global::System.Convert.ToString); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("Circuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EndpointsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("SecondaryCircuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState.CreateFrom); - } - if (content.Contains("NetworkBlock")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NetworkBlock, global::System.Convert.ToString); - } - if (content.Contains("ManagementNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementNetwork, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ProvisioningNetwork, global::System.Convert.ToString); - } - if (content.Contains("VmotionNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VmotionNetwork, global::System.Convert.ToString); - } - if (content.Contains("VcenterPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterPassword, global::System.Convert.ToString); - } - if (content.Contains("NsxtPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtPassword, global::System.Convert.ToString); - } - if (content.Contains("VcenterCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("NsxtCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("ExternalCloudLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ExternalCloudLink = (string[]) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("CircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("EndpointNsxtManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointNsxtManager, global::System.Convert.ToString); - } - if (content.Contains("EndpointVcsa")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointVcsa, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); - } - if (content.Contains("EndpointHcxCloudManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - 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.VMware.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 private cloud resource - [System.ComponentModel.TypeConverter(typeof(PrivateCloudTypeConverter))] - public partial interface IPrivateCloud - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.PowerShell.cs deleted file mode 100644 index c878a06daf3e..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.PowerShell.cs +++ /dev/null @@ -1,500 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// The properties of a private cloud resource - [System.ComponentModel.TypeConverter(typeof(PrivateCloudPropertiesTypeConverter))] - public partial class PrivateCloudProperties - { - - /// - /// 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.VMware.Models.Api20211201.IPrivateCloudProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PrivateCloudProperties(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.VMware.Models.Api20211201.IPrivateCloudProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PrivateCloudProperties(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.VMware.Models.Api20211201.IPrivateCloudProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PrivateCloudProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Circuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EndpointsTypeConverter.ConvertFrom); - } - if (content.Contains("SecondaryCircuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState.CreateFrom); - } - if (content.Contains("NetworkBlock")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NetworkBlock, global::System.Convert.ToString); - } - if (content.Contains("ManagementNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ManagementNetwork, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork, global::System.Convert.ToString); - } - if (content.Contains("VmotionNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VmotionNetwork, global::System.Convert.ToString); - } - if (content.Contains("VcenterPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterPassword, global::System.Convert.ToString); - } - if (content.Contains("NsxtPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtPassword, global::System.Convert.ToString); - } - if (content.Contains("VcenterCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("NsxtCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("ExternalCloudLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ExternalCloudLink = (string[]) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("CircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("CircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("EndpointNsxtManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager, global::System.Convert.ToString); - } - if (content.Contains("EndpointVcsa")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointVcsa, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); - } - if (content.Contains("EndpointHcxCloudManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, 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 PrivateCloudProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Circuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("Endpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EndpointsTypeConverter.ConvertFrom); - } - if (content.Contains("SecondaryCircuit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CircuitTypeConverter.ConvertFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState.CreateFrom); - } - if (content.Contains("NetworkBlock")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NetworkBlock, global::System.Convert.ToString); - } - if (content.Contains("ManagementNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ManagementNetwork, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork, global::System.Convert.ToString); - } - if (content.Contains("VmotionNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VmotionNetwork, global::System.Convert.ToString); - } - if (content.Contains("VcenterPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterPassword, global::System.Convert.ToString); - } - if (content.Contains("NsxtPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtPassword, global::System.Convert.ToString); - } - if (content.Contains("VcenterCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("NsxtCertificateThumbprint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); - } - if (content.Contains("ExternalCloudLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ExternalCloudLink = (string[]) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("CircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("CircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("EndpointNsxtManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager, global::System.Convert.ToString); - } - if (content.Contains("EndpointVcsa")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointVcsa, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("CircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); - } - if (content.Contains("EndpointHcxCloudManager")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitPrimarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitSecondarySubnet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRouteId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); - } - if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, 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.VMware.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(); - } - } - /// The properties of a private cloud resource - [System.ComponentModel.TypeConverter(typeof(PrivateCloudPropertiesTypeConverter))] - public partial interface IPrivateCloudProperties - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.PowerShell.cs deleted file mode 100644 index 1fd67c39e7f3..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.PowerShell.cs +++ /dev/null @@ -1,356 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// An update to a private cloud resource - [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdateTypeConverter))] - public partial class PrivateCloudUpdate - { - - /// - /// 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.VMware.Models.Api20211201.IPrivateCloudUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PrivateCloudUpdate(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.VMware.Models.Api20211201.IPrivateCloudUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PrivateCloudUpdate(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.VMware.Models.Api20211201.IPrivateCloudUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PrivateCloudUpdate(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.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdatePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PrivateCloudUpdate(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.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdatePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - 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.VMware.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(); - } - } - /// An update to a private cloud resource - [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdateTypeConverter))] - public partial interface IPrivateCloudUpdate - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.cs deleted file mode 100644 index 06390136abf4..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.cs +++ /dev/null @@ -1,386 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// An update to a private cloud resource - public partial class PrivateCloudUpdate : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal - { - - /// The secondary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone = value ?? default(int); } - - /// The availability strategy for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); } - - /// The primary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone = value ?? default(int); } - - /// Status of customer managed encryption key - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity _identity; - - /// The identity of the private cloud, if configured. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity()); set => this._identity = value; } - - /// - /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).PrincipalId; } - - /// vCenter Single Sign On Identity Sources - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource = value ?? null /* arrayOf */; } - - /// - /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).TenantId; } - - /// - /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType)""); } - - /// Connectivity to internet is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Internet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Internet = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum)""); } - - /// The name of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName = value ?? null; } - - /// The state of key provided - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; } - - /// The URL of the vault. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl = value ?? null; } - - /// The version of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion = value ?? null; } - - /// Property of the key if user provided or auto detected - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; } - - /// The hosts - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost = value ?? null /* arrayOf */; } - - /// The identity - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; } - - /// The state of the cluster provisioning - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; } - - /// The cluster size - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize = value ?? default(int); } - - /// Internal Acessors for Availability - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Availability = value; } - - /// Internal Acessors for Encryption - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Encryption = value; } - - /// Internal Acessors for EncryptionKeyVaultProperty - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty = value; } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity()); set { {_identity = value;} } } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).PrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).TenantId = value; } - - /// Internal Acessors for KeyVaultPropertyKeyState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState = value; } - - /// Internal Acessors for KeyVaultPropertyVersionType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType = value; } - - /// Internal Acessors for ManagementCluster - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster = value; } - - /// Internal Acessors for ManagementClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId = value; } - - /// Internal Acessors for ManagementClusterProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties _property; - - /// The updatable properties of a private cloud resource - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags _tag; - - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTags()); set => this._tag = value; } - - /// Creates an new instance. - public PrivateCloudUpdate() - { - - } - } - /// An update to a private cloud resource - public partial interface IPrivateCloudUpdate : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable - { - /// The secondary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The secondary availability zone for the private cloud", - SerializedName = @"secondaryZone", - PossibleTypes = new [] { typeof(int) })] - int? AvailabilitySecondaryZone { get; set; } - /// The availability strategy for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The availability strategy for the private cloud", - SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get; set; } - /// The primary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The primary availability zone for the private cloud", - SerializedName = @"zone", - PossibleTypes = new [] { typeof(int) })] - int? AvailabilityZone { get; set; } - /// Status of customer managed encryption key - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Status of customer managed encryption key", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get; set; } - /// - /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The principal ID of private cloud identity. This property will only be provided for a system assigned identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string IdentityPrincipalId { get; } - /// vCenter Single Sign On Identity Sources - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"vCenter Single Sign On Identity Sources", - SerializedName = @"identitySources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get; set; } - /// - /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string IdentityTenantId { get; } - /// - /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? IdentityType { get; set; } - /// Connectivity to internet is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Connectivity to internet is enabled or disabled", - SerializedName = @"internet", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get; set; } - /// The name of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name of the key.", - SerializedName = @"keyName", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyName { get; set; } - /// The state of key provided - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The state of key provided", - SerializedName = @"keyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; } - /// The URL of the vault. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the vault.", - SerializedName = @"keyVaultUrl", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyVaultUrl { get; set; } - /// The version of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The version of the key.", - SerializedName = @"keyVersion", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyVersion { get; set; } - /// Property of the key if user provided or auto detected - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Property of the key if user provided or auto detected", - SerializedName = @"versionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; } - /// The hosts - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The hosts", - SerializedName = @"hosts", - PossibleTypes = new [] { typeof(string) })] - string[] ManagementClusterHost { get; set; } - /// The identity - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The identity", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(int) })] - int? ManagementClusterId { get; } - /// The state of the cluster provisioning - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The state of the cluster provisioning", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get; } - /// The cluster size - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The cluster size", - SerializedName = @"clusterSize", - PossibleTypes = new [] { typeof(int) })] - int? ManagementClusterSize { get; set; } - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get; set; } - - } - /// An update to a private cloud resource - internal partial interface IPrivateCloudUpdateInternal - - { - /// Properties describing how the cloud is distributed across availability zones - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Availability { get; set; } - /// The secondary availability zone for the private cloud - int? AvailabilitySecondaryZone { get; set; } - /// The availability strategy for the private cloud - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get; set; } - /// The primary availability zone for the private cloud - int? AvailabilityZone { get; set; } - /// Customer managed key encryption, can be enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Encryption { get; set; } - /// The key vault where the encryption key is stored - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get; set; } - /// Status of customer managed encryption key - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get; set; } - /// The identity of the private cloud, if configured. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity Identity { get; set; } - /// - /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. - /// - string IdentityPrincipalId { get; set; } - /// vCenter Single Sign On Identity Sources - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get; set; } - /// - /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. - /// - string IdentityTenantId { get; set; } - /// - /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? IdentityType { get; set; } - /// Connectivity to internet is enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get; set; } - /// The name of the key. - string KeyVaultPropertyKeyName { get; set; } - /// The state of key provided - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; set; } - /// The URL of the vault. - string KeyVaultPropertyKeyVaultUrl { get; set; } - /// The version of the key. - string KeyVaultPropertyKeyVersion { get; set; } - /// Property of the key if user provided or auto detected - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; set; } - /// The default cluster used for management - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties ManagementCluster { get; set; } - /// The hosts - string[] ManagementClusterHost { get; set; } - /// The identity - int? ManagementClusterId { get; set; } - /// The state of the cluster provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get; set; } - /// The cluster size - int? ManagementClusterSize { get; set; } - /// The updatable properties of a private cloud resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties Property { get; set; } - /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.PowerShell.cs deleted file mode 100644 index c32687d31a84..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.PowerShell.cs +++ /dev/null @@ -1,310 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// The properties of a private cloud resource that may be updated - [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdatePropertiesTypeConverter))] - public partial class PrivateCloudUpdateProperties - { - - /// - /// 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.VMware.Models.Api20211201.IPrivateCloudUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PrivateCloudUpdateProperties(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.VMware.Models.Api20211201.IPrivateCloudUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PrivateCloudUpdateProperties(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.VMware.Models.Api20211201.IPrivateCloudUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PrivateCloudUpdateProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PrivateCloudUpdateProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ManagementCluster")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Availability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Encryption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionTypeConverter.ConvertFrom); - } - if (content.Contains("Internet")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum?) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).Internet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum.CreateFrom); - } - if (content.Contains("IdentitySource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySourceTypeConverter.ConvertFrom)); - } - if (content.Contains("AvailabilityStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); - } - if (content.Contains("ManagementClusterSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("ManagementClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("ManagementClusterHost")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (string[]) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("AvailabilitySecondaryZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("EncryptionKeyVaultProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); - } - if (content.Contains("KeyVaultPropertyKeyName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyVaultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); - } - if (content.Contains("KeyVaultPropertyKeyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); - } - if (content.Contains("KeyVaultPropertyVersionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); - } - 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.VMware.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(); - } - } - /// The properties of a private cloud resource that may be updated - [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdatePropertiesTypeConverter))] - public partial interface IPrivateCloudUpdateProperties - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.cs deleted file mode 100644 index 036c59fd7aba..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.cs +++ /dev/null @@ -1,303 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// The properties of a private cloud resource that may be updated - public partial class PrivateCloudUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties _availability; - - /// Properties describing how the cloud is distributed across availability zones - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Availability { get => (this._availability = this._availability ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityProperties()); set => this._availability = value; } - - /// The secondary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)Availability).SecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)Availability).SecondaryZone = value ?? default(int); } - - /// The availability strategy for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)Availability).Strategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)Availability).Strategy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); } - - /// The primary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)Availability).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)Availability).Zone = value ?? default(int); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption _encryption; - - /// Customer managed key encryption, can be enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Encryption()); set => this._encryption = value; } - - /// Status of customer managed encryption key - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] _identitySource; - - /// vCenter Single Sign On Identity Sources - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => this._identitySource; set => this._identitySource = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? _internet; - - /// Connectivity to internet is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get => this._internet; set => this._internet = value; } - - /// The name of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyName = value ?? null; } - - /// The state of key provided - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyState; } - - /// The URL of the vault. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVaultUrl = value ?? null; } - - /// The version of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVersion = value ?? null; } - - /// Property of the key if user provided or auto detected - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyVersionType; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties _managementCluster; - - /// The default cluster used for management - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties ManagementCluster { get => (this._managementCluster = this._managementCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties()); set => this._managementCluster = value; } - - /// The hosts - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).Host = value ?? null /* arrayOf */; } - - /// The identity - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ClusterId; } - - /// The state of the cluster provisioning - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ProvisioningState; } - - /// The cluster size - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ClusterSize = value ?? default(int); } - - /// Internal Acessors for Availability - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.Availability { get => (this._availability = this._availability ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityProperties()); set { {_availability = value;} } } - - /// Internal Acessors for Encryption - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Encryption()); set { {_encryption = value;} } } - - /// Internal Acessors for EncryptionKeyVaultProperty - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultProperty = value; } - - /// Internal Acessors for KeyVaultPropertyKeyState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyKeyState = value; } - - /// Internal Acessors for KeyVaultPropertyVersionType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)Encryption).KeyVaultPropertyVersionType = value; } - - /// Internal Acessors for ManagementCluster - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.ManagementCluster { get => (this._managementCluster = this._managementCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties()); set { {_managementCluster = value;} } } - - /// Internal Acessors for ManagementClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ClusterId = value; } - - /// Internal Acessors for ManagementClusterProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)ManagementCluster).ProvisioningState = value; } - - /// Creates an new instance. - public PrivateCloudUpdateProperties() - { - - } - } - /// The properties of a private cloud resource that may be updated - public partial interface IPrivateCloudUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable - { - /// The secondary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The secondary availability zone for the private cloud", - SerializedName = @"secondaryZone", - PossibleTypes = new [] { typeof(int) })] - int? AvailabilitySecondaryZone { get; set; } - /// The availability strategy for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The availability strategy for the private cloud", - SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get; set; } - /// The primary availability zone for the private cloud - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The primary availability zone for the private cloud", - SerializedName = @"zone", - PossibleTypes = new [] { typeof(int) })] - int? AvailabilityZone { get; set; } - /// Status of customer managed encryption key - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Status of customer managed encryption key", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get; set; } - /// vCenter Single Sign On Identity Sources - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"vCenter Single Sign On Identity Sources", - SerializedName = @"identitySources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get; set; } - /// Connectivity to internet is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Connectivity to internet is enabled or disabled", - SerializedName = @"internet", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get; set; } - /// The name of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name of the key.", - SerializedName = @"keyName", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyName { get; set; } - /// The state of key provided - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The state of key provided", - SerializedName = @"keyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; } - /// The URL of the vault. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the vault.", - SerializedName = @"keyVaultUrl", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyVaultUrl { get; set; } - /// The version of the key. - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The version of the key.", - SerializedName = @"keyVersion", - PossibleTypes = new [] { typeof(string) })] - string KeyVaultPropertyKeyVersion { get; set; } - /// Property of the key if user provided or auto detected - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Property of the key if user provided or auto detected", - SerializedName = @"versionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; } - /// The hosts - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The hosts", - SerializedName = @"hosts", - PossibleTypes = new [] { typeof(string) })] - string[] ManagementClusterHost { get; set; } - /// The identity - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The identity", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(int) })] - int? ManagementClusterId { get; } - /// The state of the cluster provisioning - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The state of the cluster provisioning", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get; } - /// The cluster size - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The cluster size", - SerializedName = @"clusterSize", - PossibleTypes = new [] { typeof(int) })] - int? ManagementClusterSize { get; set; } - - } - /// The properties of a private cloud resource that may be updated - internal partial interface IPrivateCloudUpdatePropertiesInternal - - { - /// Properties describing how the cloud is distributed across availability zones - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Availability { get; set; } - /// The secondary availability zone for the private cloud - int? AvailabilitySecondaryZone { get; set; } - /// The availability strategy for the private cloud - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get; set; } - /// The primary availability zone for the private cloud - int? AvailabilityZone { get; set; } - /// Customer managed key encryption, can be enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Encryption { get; set; } - /// The key vault where the encryption key is stored - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get; set; } - /// Status of customer managed encryption key - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get; set; } - /// vCenter Single Sign On Identity Sources - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get; set; } - /// Connectivity to internet is enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get; set; } - /// The name of the key. - string KeyVaultPropertyKeyName { get; set; } - /// The state of key provided - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; set; } - /// The URL of the vault. - string KeyVaultPropertyKeyVaultUrl { get; set; } - /// The version of the key. - string KeyVaultPropertyKeyVersion { get; set; } - /// Property of the key if user provided or auto detected - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; set; } - /// The default cluster used for management - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties ManagementCluster { get; set; } - /// The hosts - string[] ManagementClusterHost { get; set; } - /// The identity - int? ManagementClusterId { get; set; } - /// The state of the cluster provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get; set; } - /// The cluster size - int? ManagementClusterSize { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.PowerShell.cs deleted file mode 100644 index 9ef5a06c17d2..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.PowerShell.cs +++ /dev/null @@ -1,308 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// An instance of a script executed by a user - custom or AVS - [System.ComponentModel.TypeConverter(typeof(ScriptExecutionTypeConverter))] - public partial class ScriptExecution - { - - /// - /// 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.VMware.Models.Api20211201.IScriptExecution DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ScriptExecution(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.VMware.Models.Api20211201.IScriptExecution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ScriptExecution(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.VMware.Models.Api20211201.IScriptExecution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ScriptExecution(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.VMware.Models.Api20211201.IScriptExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ScriptCmdletId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ScriptCmdletId, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("HiddenParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).HiddenParameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("FailureReason")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FailureReason, global::System.Convert.ToString); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Timeout, global::System.Convert.ToString); - } - if (content.Contains("Retention")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Retention, global::System.Convert.ToString); - } - if (content.Contains("SubmittedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("StartedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FinishedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState.CreateFrom); - } - if (content.Contains("Output")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Output = (string[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NamedOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); - } - if (content.Contains("Information")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Information = (string[]) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Information, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Warning")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Warning = (string[]) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Warning, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Error = (string[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Error, __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 ScriptExecution(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.VMware.Models.Api20211201.IScriptExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ScriptCmdletId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ScriptCmdletId, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("HiddenParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).HiddenParameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("FailureReason")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FailureReason, global::System.Convert.ToString); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Timeout, global::System.Convert.ToString); - } - if (content.Contains("Retention")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Retention, global::System.Convert.ToString); - } - if (content.Contains("SubmittedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("StartedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FinishedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState.CreateFrom); - } - if (content.Contains("Output")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Output = (string[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NamedOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); - } - if (content.Contains("Information")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Information = (string[]) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Information, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Warning")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Warning = (string[]) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Warning, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Error = (string[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal)this).Error, __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.VMware.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(); - } - } - /// An instance of a script executed by a user - custom or AVS - [System.ComponentModel.TypeConverter(typeof(ScriptExecutionTypeConverter))] - public partial interface IScriptExecution - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.PowerShell.cs deleted file mode 100644 index 3ca7787bb2ea..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.PowerShell.cs +++ /dev/null @@ -1,276 +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.VMware.Models.Api20211201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; - - /// Properties of a user-invoked script - [System.ComponentModel.TypeConverter(typeof(ScriptExecutionPropertiesTypeConverter))] - public partial class ScriptExecutionProperties - { - - /// - /// 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.VMware.Models.Api20211201.IScriptExecutionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ScriptExecutionProperties(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.VMware.Models.Api20211201.IScriptExecutionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ScriptExecutionProperties(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.VMware.Models.Api20211201.IScriptExecutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ScriptExecutionProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScriptCmdletId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ScriptCmdletId, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("HiddenParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).HiddenParameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("FailureReason")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FailureReason, global::System.Convert.ToString); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Timeout, global::System.Convert.ToString); - } - if (content.Contains("Retention")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Retention, global::System.Convert.ToString); - } - if (content.Contains("SubmittedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("StartedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FinishedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState.CreateFrom); - } - if (content.Contains("Output")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Output = (string[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NamedOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); - } - if (content.Contains("Information")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Information = (string[]) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Information, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Warning")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Warning = (string[]) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Warning, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Error = (string[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Error, __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 ScriptExecutionProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ScriptCmdletId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ScriptCmdletId, global::System.Convert.ToString); - } - if (content.Contains("Parameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("HiddenParameter")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).HiddenParameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameterTypeConverter.ConvertFrom)); - } - if (content.Contains("FailureReason")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FailureReason, global::System.Convert.ToString); - } - if (content.Contains("Timeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Timeout, global::System.Convert.ToString); - } - if (content.Contains("Retention")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Retention, global::System.Convert.ToString); - } - if (content.Contains("SubmittedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("StartedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("FinishedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState.CreateFrom); - } - if (content.Contains("Output")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Output = (string[]) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NamedOutput")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); - } - if (content.Contains("Information")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Information = (string[]) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Information, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Warning")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Warning = (string[]) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Warning, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Error = (string[]) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)this).Error, __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.VMware.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(); - } - } - /// Properties of a user-invoked script - [System.ComponentModel.TypeConverter(typeof(ScriptExecutionPropertiesTypeConverter))] - public partial interface IScriptExecutionProperties - - { - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.cs deleted file mode 100644 index 200ef438d95a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.cs +++ /dev/null @@ -1,123 +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.VMware.Models.Api20211201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - - /// VM-Host placement policy properties - public partial class VMHostPlacementPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties(); - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType _affinityType; - - /// placement policy affinity type - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AffinityType { get => this._affinityType; set => this._affinityType = value; } - - /// Display name of the placement policy - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName = value ?? null; } - - /// Backing field for property. - private string[] _hostMember; - - /// Host members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] HostMember { get => this._hostMember; set => this._hostMember = value; } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState = value; } - - /// The provisioning state - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; } - - /// Whether the placement policy is enabled or disabled - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState)""); } - - /// placement policy type - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).Type = value ; } - - /// Backing field for property. - private string[] _vMMember; - - /// Virtual machine members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] VMMember { get => this._vMMember; set => this._vMMember = value; } - - /// Creates an new instance. - public VMHostPlacementPolicyProperties() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__placementPolicyProperties), __placementPolicyProperties); - await eventListener.AssertObjectIsValid(nameof(__placementPolicyProperties), __placementPolicyProperties); - } - } - /// VM-Host placement policy properties - public partial interface IVMHostPlacementPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties - { - /// placement policy affinity type - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"placement policy affinity type", - SerializedName = @"affinityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AffinityType { get; set; } - /// Host members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Host members list", - SerializedName = @"hostMembers", - PossibleTypes = new [] { typeof(string) })] - string[] HostMember { get; set; } - /// Virtual machine members list - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Virtual machine members list", - SerializedName = @"vmMembers", - PossibleTypes = new [] { typeof(string) })] - string[] VMMember { get; set; } - - } - /// VM-Host placement policy properties - internal partial interface IVMHostPlacementPolicyPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal - { - /// placement policy affinity type - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AffinityType { get; set; } - /// Host members list - string[] HostMember { get; set; } - /// Virtual machine members list - string[] VMMember { get; set; } - - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.PowerShell.cs index 71544007f138..857b72204a9e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AvailabilityProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal AvailabilityProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Strategy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Strategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("Strategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Strategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Strategy = (string) content.GetValueForProperty("Strategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Strategy, global::System.Convert.ToString); } if (content.Contains("Zone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Zone = (int?) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Zone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Zone = (int?) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Zone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("SecondaryZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).SecondaryZone = (int?) content.GetValueForProperty("SecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).SecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).SecondaryZone = (int?) content.GetValueForProperty("SecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).SecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } 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. @@ -107,41 +107,41 @@ internal AvailabilityProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Strategy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Strategy = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy?) content.GetValueForProperty("Strategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Strategy, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Strategy = (string) content.GetValueForProperty("Strategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Strategy, global::System.Convert.ToString); } if (content.Contains("Zone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Zone = (int?) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).Zone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Zone = (int?) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).Zone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("SecondaryZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).SecondaryZone = (int?) content.GetValueForProperty("SecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal)this).SecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).SecondaryZone = (int?) content.GetValueForProperty("SecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)this).SecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } 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.VMware.Models.Api20211201.IAvailabilityProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AvailabilityProperties(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.VMware.Models.Api20211201.IAvailabilityProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AvailabilityProperties(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvai /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.TypeConverter.cs index 043e989857a0..376ff1ba8937 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAvailabilityProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.cs index 28d48c2d12e1..983440132b76 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties describing private cloud availability zone distribution public partial class AvailabilityProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AvailabilityProperties : public int? SecondaryZone { get => this._secondaryZone; set => this._secondaryZone = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? _strategy; + private string _strategy; /// The availability strategy for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? Strategy { get => this._strategy; set => this._strategy = value; } + public string Strategy { get => this._strategy; set => this._strategy = value; } /// Backing field for property. private int? _zone; @@ -48,6 +48,9 @@ public partial interface IAvailabilityProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The secondary availability zone for the private cloud", SerializedName = @"secondaryZone", PossibleTypes = new [] { typeof(int) })] @@ -56,14 +59,21 @@ public partial interface IAvailabilityProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The availability strategy for the private cloud", SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? Strategy { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string Strategy { get; set; } /// The primary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The primary availability zone for the private cloud", SerializedName = @"zone", PossibleTypes = new [] { typeof(int) })] @@ -77,7 +87,8 @@ internal partial interface IAvailabilityPropertiesInternal /// The secondary availability zone for the private cloud int? SecondaryZone { get; set; } /// The availability strategy for the private cloud - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? Strategy { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string Strategy { get; set; } /// The primary availability zone for the private cloud int? Zone { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.json.cs index 0e9f0b80ba75..79bd2484b836 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/AvailabilityProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/AvailabilityProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AvailabilityProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - {_strategy = If( json?.PropertyT("strategy"), out var __jsonStrategy) ? (string)__jsonStrategy : (string)Strategy;} - {_zone = If( json?.PropertyT("zone"), out var __jsonZone) ? (int?)__jsonZone : Zone;} - {_secondaryZone = If( json?.PropertyT("secondaryZone"), out var __jsonSecondaryZone) ? (int?)__jsonSecondaryZone : SecondaryZone;} + {_strategy = If( json?.PropertyT("strategy"), out var __jsonStrategy) ? (string)__jsonStrategy : (string)_strategy;} + {_zone = If( json?.PropertyT("zone"), out var __jsonZone) ? (int?)__jsonZone : _zone;} + {_secondaryZone = If( json?.PropertyT("secondaryZone"), out var __jsonSecondaryZone) ? (int?)__jsonSecondaryZone : _secondaryZone;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new AvailabilityProperties(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Circuit.PowerShell.cs index bb6ef14702f7..4caaa4882f24 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Circuit partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal Circuit(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrimarySubnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).PrimarySubnet = (string) content.GetValueForProperty("PrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).PrimarySubnet, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).PrimarySubnet = (string) content.GetValueForProperty("PrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).PrimarySubnet, global::System.Convert.ToString); } if (content.Contains("SecondarySubnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).SecondarySubnet = (string) content.GetValueForProperty("SecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).SecondarySubnet, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).SecondarySubnet = (string) content.GetValueForProperty("SecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).SecondarySubnet, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRouteId, global::System.Convert.ToString); } if (content.Contains("ExpressRoutePrivatePeeringId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("ExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRoutePrivatePeeringId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("ExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRoutePrivatePeeringId, 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. @@ -111,45 +111,45 @@ internal Circuit(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("PrimarySubnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).PrimarySubnet = (string) content.GetValueForProperty("PrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).PrimarySubnet, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).PrimarySubnet = (string) content.GetValueForProperty("PrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).PrimarySubnet, global::System.Convert.ToString); } if (content.Contains("SecondarySubnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).SecondarySubnet = (string) content.GetValueForProperty("SecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).SecondarySubnet, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).SecondarySubnet = (string) content.GetValueForProperty("SecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).SecondarySubnet, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRouteId, global::System.Convert.ToString); } if (content.Contains("ExpressRoutePrivatePeeringId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("ExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)this).ExpressRoutePrivatePeeringId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("ExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)this).ExpressRoutePrivatePeeringId, 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.VMware.Models.Api20211201.ICircuit DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Circuit(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.VMware.Models.Api20211201.ICircuit DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Circuit(content); } @@ -159,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICirc /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Circuit.TypeConverter.cs index 834d283a30af..cab903b66d9b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICircuit ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.cs b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.cs similarity index 84% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Circuit.cs index 97d0c762e93a..12e12fbce20e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An ExpressRoute Circuit public partial class Circuit : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal { /// Backing field for property. @@ -28,16 +28,16 @@ public partial class Circuit : public string ExpressRoutePrivatePeeringId { get => this._expressRoutePrivatePeeringId; } /// Internal Acessors for ExpressRouteId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal.ExpressRouteId { get => this._expressRouteId; set { {_expressRouteId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal.ExpressRouteId { get => this._expressRouteId; set { {_expressRouteId = value;} } } /// Internal Acessors for ExpressRoutePrivatePeeringId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal.ExpressRoutePrivatePeeringId { get => this._expressRoutePrivatePeeringId; set { {_expressRoutePrivatePeeringId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal.ExpressRoutePrivatePeeringId { get => this._expressRoutePrivatePeeringId; set { {_expressRoutePrivatePeeringId = value;} } } /// Internal Acessors for PrimarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal.PrimarySubnet { get => this._primarySubnet; set { {_primarySubnet = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal.PrimarySubnet { get => this._primarySubnet; set { {_primarySubnet = value;} } } /// Internal Acessors for SecondarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal.SecondarySubnet { get => this._secondarySubnet; set { {_secondarySubnet = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal.SecondarySubnet { get => this._secondarySubnet; set { {_secondarySubnet = value;} } } /// Backing field for property. private string _primarySubnet; @@ -67,6 +67,9 @@ public partial interface ICircuit : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the ExpressRoute Circuit (Microsoft Colo only)", SerializedName = @"expressRouteID", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface ICircuit : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ExpressRoute Circuit private peering identifier", SerializedName = @"expressRoutePrivatePeeringID", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface ICircuit : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of primary subnet", SerializedName = @"primarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface ICircuit : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of secondary subnet", SerializedName = @"secondarySubnet", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Circuit.json.cs index 2d55abcc936f..8735b1ef744b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Circuit.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Circuit.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,19 @@ internal Circuit(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObje { return; } - {_primarySubnet = If( json?.PropertyT("primarySubnet"), out var __jsonPrimarySubnet) ? (string)__jsonPrimarySubnet : (string)PrimarySubnet;} - {_secondarySubnet = If( json?.PropertyT("secondarySubnet"), out var __jsonSecondarySubnet) ? (string)__jsonSecondarySubnet : (string)SecondarySubnet;} - {_expressRouteId = If( json?.PropertyT("expressRouteID"), out var __jsonExpressRouteId) ? (string)__jsonExpressRouteId : (string)ExpressRouteId;} - {_expressRoutePrivatePeeringId = If( json?.PropertyT("expressRoutePrivatePeeringID"), out var __jsonExpressRoutePrivatePeeringId) ? (string)__jsonExpressRoutePrivatePeeringId : (string)ExpressRoutePrivatePeeringId;} + {_primarySubnet = If( json?.PropertyT("primarySubnet"), out var __jsonPrimarySubnet) ? (string)__jsonPrimarySubnet : (string)_primarySubnet;} + {_secondarySubnet = If( json?.PropertyT("secondarySubnet"), out var __jsonSecondarySubnet) ? (string)__jsonSecondarySubnet : (string)_secondarySubnet;} + {_expressRouteId = If( json?.PropertyT("expressRouteID"), out var __jsonExpressRouteId) ? (string)__jsonExpressRouteId : (string)_expressRouteId;} + {_expressRoutePrivatePeeringId = If( json?.PropertyT("expressRoutePrivatePeeringID"), out var __jsonExpressRoutePrivatePeeringId) ? (string)__jsonExpressRoutePrivatePeeringId : (string)_expressRoutePrivatePeeringId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Circuit(json) : null; } @@ -103,19 +101,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._primarySubnet)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._primarySubnet.ToString()) : null, "primarySubnet" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._secondarySubnet)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._secondarySubnet.ToString()) : null, "secondarySubnet" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._expressRouteId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._expressRouteId.ToString()) : null, "expressRouteID" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._expressRoutePrivatePeeringId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._expressRoutePrivatePeeringId.ToString()) : null, "expressRoutePrivatePeeringID" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.PowerShell.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLink.PowerShell.cs index d9afd2e0e8d4..376a952b6cff 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CloudLink partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,33 +78,33 @@ internal CloudLink(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("LinkedCloud")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).LinkedCloud, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).LinkedCloud, 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. @@ -119,53 +119,53 @@ internal CloudLink(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("LinkedCloud")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal)this).LinkedCloud, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal)this).LinkedCloud, 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.VMware.Models.Api20211201.ICloudLink DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudLink(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.VMware.Models.Api20211201.ICloudLink DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudLink(content); } @@ -175,7 +175,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClou /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLink.TypeConverter.cs index 90a6c1aaf2a4..f20a0428b55d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLink ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.cs similarity index 62% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLink.cs index e048c89279a5..f075c217c467 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.cs @@ -3,55 +3,54 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A cloud link resource public partial class CloudLink : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Identifier of the other private cloud participating in the link. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string LinkedCloud { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)Property).LinkedCloud; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)Property).LinkedCloud = value ?? null; } + public string LinkedCloud { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)Property).LinkedCloud; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)Property).LinkedCloud = value ?? null; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkProperties()); set { {_property = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)Property).Status = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties _property; /// The properties of a cloud link. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -59,11 +58,11 @@ public partial class CloudLink : /// The state of the cloud link. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)Property).Status; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public CloudLink() @@ -86,12 +85,15 @@ public CloudLink() /// A cloud link resource public partial interface ICloudLink : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// Identifier of the other private cloud participating in the link. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identifier of the other private cloud participating in the link.", SerializedName = @"linkedCloud", PossibleTypes = new [] { typeof(string) })] @@ -100,22 +102,27 @@ public partial interface ICloudLink : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the cloud link.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Active", "Building", "Deleting", "Failed", "Disconnected")] + string Status { get; } } /// A cloud link resource internal partial interface ICloudLinkInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// Identifier of the other private cloud participating in the link. string LinkedCloud { get; set; } /// The properties of a cloud link. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties Property { get; set; } /// The state of the cloud link. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Active", "Building", "Deleting", "Failed", "Disconnected")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLink.json.cs index b87a3ec97216..d2cfe0264248 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLink.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLink.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal CloudLink(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonOb { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new CloudLink(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.PowerShell.cs index 277ba0ecf3be..70100a50a0a8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CloudLinkList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal CloudLinkList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).NextLink, 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. @@ -103,37 +103,37 @@ internal CloudLinkList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal)this).NextLink, 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.VMware.Models.Api20211201.ICloudLinkList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudLinkList(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.VMware.Models.Api20211201.ICloudLinkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudLinkList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClou /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.TypeConverter.cs index d2aa09654187..4d6c762d3d76 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLinkList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.cs index 72691d286e58..8d7b4d3b2ecf 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of cloud links public partial class CloudLinkList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class CloudLinkList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public CloudLinkList() @@ -47,6 +47,9 @@ public partial interface ICloudLinkList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface ICloudLinkList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink) })] + System.Collections.Generic.List Value { get; } } /// A paged list of cloud links @@ -68,7 +74,7 @@ internal partial interface ICloudLinkListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.json.cs index 3b8b9f78e48a..0300d342f831 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal CloudLinkList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLink) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLink.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.VMware.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.VMware.Models.ICloudLink) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new CloudLinkList(json) : null; } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.PowerShell.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.PowerShell.cs index 175b26c0bc52..ea75b231b6c6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CloudLinkProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal CloudLinkProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("LinkedCloud")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).LinkedCloud, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).LinkedCloud, 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. @@ -103,37 +103,37 @@ internal CloudLinkProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("LinkedCloud")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal)this).LinkedCloud, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).LinkedCloud = (string) content.GetValueForProperty("LinkedCloud",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal)this).LinkedCloud, 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.VMware.Models.Api20211201.ICloudLinkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudLinkProperties(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.VMware.Models.Api20211201.ICloudLinkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudLinkProperties(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClou /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.TypeConverter.cs index 0c82115fa7dd..7af96289f2e2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLinkProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.cs similarity index 72% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.cs index bf34fe39fbf5..1785cccfaa9e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a cloud link. public partial class CloudLinkProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal { /// Backing field for property. @@ -21,14 +21,14 @@ public partial class CloudLinkProperties : public string LinkedCloud { get => this._linkedCloud; set => this._linkedCloud = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? _status; + private string _status; /// The state of the cloud link. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public CloudLinkProperties() @@ -44,6 +44,9 @@ public partial interface ICloudLinkProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identifier of the other private cloud participating in the link.", SerializedName = @"linkedCloud", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,14 @@ public partial interface ICloudLinkProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the cloud link.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Active", "Building", "Deleting", "Failed", "Disconnected")] + string Status { get; } } /// The properties of a cloud link. @@ -65,7 +72,8 @@ internal partial interface ICloudLinkPropertiesInternal /// Identifier of the other private cloud participating in the link. string LinkedCloud { get; set; } /// The state of the cloud link. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Active", "Building", "Deleting", "Failed", "Disconnected")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.json.cs index 724beba00daf..00f522728c2d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudLinkProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CloudLinkProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CloudLinkProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_linkedCloud = If( json?.PropertyT("linkedCloud"), out var __jsonLinkedCloud) ? (string)__jsonLinkedCloud : (string)LinkedCloud;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_linkedCloud = If( json?.PropertyT("linkedCloud"), out var __jsonLinkedCloud) ? (string)__jsonLinkedCloud : (string)_linkedCloud;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLinkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new CloudLinkProperties(json) : null; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.PowerShell.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Cluster.PowerShell.cs index 249b3a6bf9c5..3abc69ddc2b2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Cluster partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,49 +78,49 @@ internal Cluster(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.SkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.SkuTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).SkuName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("Size")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Size = (int?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Size, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Size = (int?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Size, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Host, __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. @@ -135,69 +135,69 @@ internal Cluster(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Sku")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.SkuTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.SkuTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("SkuName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).SkuName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).SkuName, global::System.Convert.ToString); } if (content.Contains("Size")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Size = (int?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Size, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Size = (int?) content.GetValueForProperty("Size",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Size, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, 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.VMware.Models.Api20211201.ICluster DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Cluster(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.VMware.Models.Api20211201.ICluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Cluster(content); } @@ -207,7 +207,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClus /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Cluster.TypeConverter.cs index cccdbc60293b..8afca285e48b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.cs b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.cs similarity index 60% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Cluster.cs index 1e4805906bd7..f2dbe214af64 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.cs @@ -3,69 +3,68 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A cluster resource public partial class Cluster : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ClusterId; } + public int? ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ClusterId; } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).Host = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).Host = value ?? null /* arrayOf */; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for ClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ClusterId = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ClusterId = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku()); set { {_sku = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku()); set { {_sku = value;} } } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties _property; /// The properties of a cluster resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterProperties()); set => this._property = value; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -73,22 +72,22 @@ public partial class Cluster : /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? Size { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)Property).ClusterSize = value ?? default(int); } + public int? Size { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)Property).ClusterSize = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku _sku; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku _sku; /// The cluster SKU [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku()); set => this._sku = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku()); set => this._sku = value; } /// The name of the SKU. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)Sku).Name = value ; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)Sku).Name = value ; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public Cluster() @@ -111,12 +110,15 @@ public Cluster() /// A cluster resource public partial interface ICluster : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity", SerializedName = @"clusterId", PossibleTypes = new [] { typeof(int) })] @@ -125,22 +127,32 @@ public partial interface ICluster : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the cluster provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cluster size", SerializedName = @"clusterSize", PossibleTypes = new [] { typeof(int) })] @@ -149,6 +161,9 @@ public partial interface ICluster : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the SKU.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -157,20 +172,21 @@ public partial interface ICluster : } /// A cluster resource internal partial interface IClusterInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// The identity int? ClusterId { get; set; } /// The hosts - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } /// The properties of a cluster resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties Property { get; set; } /// The state of the cluster provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// The cluster size int? Size { get; set; } /// The cluster SKU - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku Sku { get; set; } /// The name of the SKU. string SkuName { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Cluster.json.cs index 8402a4ea8d1e..1c83149945db 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Cluster.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Cluster.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,20 +65,18 @@ internal Cluster(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObje { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku.FromJson(__jsonSku) : Sku;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku.FromJson(__jsonSku) : _sku;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Cluster(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterList.PowerShell.cs index fe3256a188fb..ec5e033572ab 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal ClusterList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).NextLink, 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. @@ -103,37 +103,37 @@ internal ClusterList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal)this).NextLink, 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.VMware.Models.Api20211201.IClusterList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterList(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.VMware.Models.Api20211201.IClusterList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClus /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterList.TypeConverter.cs index 25ad1459d182..d71cc49314af 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IClusterList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterList.cs index e5beb64fb6dc..3c27f87ac379 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of clusters public partial class ClusterList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ClusterList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ClusterList() @@ -47,6 +47,9 @@ public partial interface IClusterList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IClusterList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster) })] + System.Collections.Generic.List Value { get; } } /// A paged list of clusters @@ -68,7 +74,7 @@ internal partial interface IClusterListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterList.json.cs index 9005cd96cd1a..bca28fc0df18 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal ClusterList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Json { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster.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.VMware.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.VMware.Models.ICluster) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ClusterList(json) : null; } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.PowerShell.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.PowerShell.cs index df9961a6c699..0d2e3e60067e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal ClusterProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host, __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. @@ -111,45 +111,45 @@ internal ClusterProperties(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, 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.VMware.Models.Api20211201.IClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterProperties(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.VMware.Models.Api20211201.IClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterProperties(content); } @@ -159,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClus /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.TypeConverter.cs index 907c74e93c40..987af513260b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IClusterProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.cs similarity index 53% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.cs index 8bc251c0f78b..bfdee6e843aa 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.cs @@ -3,43 +3,43 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a cluster public partial class ClusterProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CommonClusterProperties(); /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; } + public int? ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; } /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? ClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize = value ?? default(int); } + public int? ClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize = value ?? default(int); } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string[] Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).Host = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).Host = value ?? null /* arrayOf */; } /// Internal Acessors for ClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState = value; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; } /// Creates an new instance. public ClusterProperties() @@ -62,13 +62,13 @@ public ClusterProperties() /// The properties of a cluster public partial interface IClusterProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties { } /// The properties of a cluster internal partial interface IClusterPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal { } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.json.cs index 8159c1abeb2e..6bd56e179c7c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Jso { return; } - __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties(json); + __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CommonClusterProperties(json); AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ClusterProperties(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.PowerShell.cs index 447a72025d7b..2aa3472c5679 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterUpdate partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,21 +78,21 @@ internal ClusterUpdate(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Host, __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. @@ -107,41 +107,41 @@ internal ClusterUpdate(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdatePropertiesTypeConverter.ConvertFrom); } if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, 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.VMware.Models.Api20211201.IClusterUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterUpdate(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.VMware.Models.Api20211201.IClusterUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterUpdate(content); } @@ -151,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClus /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.TypeConverter.cs index 02632e287e43..8eb7d71d7498 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IClusterUpdate ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.cs index 473f1579169b..ed2c2a534116 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.cs @@ -3,33 +3,33 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An update of a cluster resource public partial class ClusterUpdate : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal { /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)Property).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)Property).ClusterSize = value ?? default(int); } + public int? ClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)Property).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)Property).ClusterSize = value ?? default(int); } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)Property).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)Property).Host = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)Property).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)Property).Host = value ?? null /* arrayOf */; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdateProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdateProperties()); set { {_property = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties _property; /// The properties of a cluster resource that may be updated [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdateProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdateProperties()); set => this._property = value; } /// Creates an new instance. public ClusterUpdate() @@ -45,6 +45,9 @@ public partial interface IClusterUpdate : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cluster size", SerializedName = @"clusterSize", PossibleTypes = new [] { typeof(int) })] @@ -53,10 +56,13 @@ public partial interface IClusterUpdate : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } } /// An update of a cluster resource @@ -66,9 +72,9 @@ internal partial interface IClusterUpdateInternal /// The cluster size int? ClusterSize { get; set; } /// The hosts - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } /// The properties of a cluster resource that may be updated - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties Property { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.json.cs index d04306021e30..036828fd03e7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdate.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,18 +65,16 @@ internal ClusterUpdate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdateProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdateProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ClusterUpdate(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.PowerShell.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.PowerShell.cs index 68876e91d50b..91b7ebd22776 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterUpdateProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal ClusterUpdateProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).Host, __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. @@ -103,37 +103,37 @@ internal ClusterUpdateProperties(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, 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.VMware.Models.Api20211201.IClusterUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterUpdateProperties(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.VMware.Models.Api20211201.IClusterUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterUpdateProperties(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClus /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.TypeConverter.cs index c7be413b934f..73a21886ac6b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IClusterUpdateProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.cs index 6bc5210e9cfd..2c0c57ee497a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a cluster that may be updated public partial class ClusterUpdateProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdatePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdatePropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ClusterUpdateProperties : public int? ClusterSize { get => this._clusterSize; set => this._clusterSize = value; } /// Backing field for property. - private string[] _host; + private System.Collections.Generic.List _host; /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Host { get => this._host; set => this._host = value; } + public System.Collections.Generic.List Host { get => this._host; set => this._host = value; } /// Creates an new instance. public ClusterUpdateProperties() @@ -41,6 +41,9 @@ public partial interface IClusterUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cluster size", SerializedName = @"clusterSize", PossibleTypes = new [] { typeof(int) })] @@ -49,10 +52,13 @@ public partial interface IClusterUpdateProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } } /// The properties of a cluster that may be updated @@ -62,7 +68,7 @@ internal partial interface IClusterUpdatePropertiesInternal /// The cluster size int? ClusterSize { get; set; } /// The hosts - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.json.cs index 16a1f7241dc4..153ab34bb031 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ClusterUpdateProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ClusterUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runti { return; } - {_clusterSize = If( json?.PropertyT("clusterSize"), out var __jsonClusterSize) ? (int?)__jsonClusterSize : ClusterSize;} - {_host = If( json?.PropertyT("hosts"), out var __jsonHosts) ? If( __jsonHosts as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Host;} + {_clusterSize = If( json?.PropertyT("clusterSize"), out var __jsonClusterSize) ? (int?)__jsonClusterSize : _clusterSize;} + {_host = If( json?.PropertyT("hosts"), out var __jsonHosts) ? If( __jsonHosts as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _host;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ClusterUpdateProperties(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.PowerShell.cs new file mode 100644 index 000000000000..c49ab2945d61 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.PowerShell.cs @@ -0,0 +1,172 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// Zone and associated hosts info + [System.ComponentModel.TypeConverter(typeof(ClusterZoneTypeConverter))] + public partial class ClusterZone + { + + /// + /// 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 a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ClusterZone(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Host")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Zone = (string) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Zone, 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 ClusterZone(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Host")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Zone = (string) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal)this).Zone, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// 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.VMware.Models.IClusterZone DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterZone(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.VMware.Models.IClusterZone DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterZone(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.VMware.Models.IClusterZone FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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(); + } + } + /// Zone and associated hosts info + [System.ComponentModel.TypeConverter(typeof(ClusterZoneTypeConverter))] + public partial interface IClusterZone + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.TypeConverter.cs similarity index 85% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.TypeConverter.cs index 96d7fec563cb..996abb81ac81 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.TypeConverter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; /// - /// A PowerShell PSTypeConverter to support converting to an instance of + /// A PowerShell PSTypeConverter to support converting to an instance of /// - public partial class CloudErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + public partial class ClusterZoneTypeConverter : global::System.Management.Automation.PSTypeConverter { /// @@ -26,12 +26,13 @@ public partial class CloudErrorTypeConverter : global::System.Management.Automat public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); /// - /// Determines if the converter can convert the parameter to the type. + /// Determines if the converter can convert the parameter to the + /// type. /// - /// the instance to check if it can be converted to the the instance to check if it can be converted to the type. /// - /// true if the instance could be converted to a type, otherwise false + /// true if the instance could be converted to a type, otherwise false /// public static bool CanConvertFrom(dynamic sourceValue) { @@ -94,31 +95,31 @@ public static bool CanConvertFrom(dynamic sourceValue) /// 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. + /// 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) => ConvertFrom(sourceValue); /// - /// Converts the parameter into an instance of + /// Converts the parameter into an instance of /// - /// the value to convert into an instance of . + /// the value to convert into an instance of . /// - /// an instance of , or null if there is no suitable conversion. + /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone).IsAssignableFrom(type)) { return sourceValue; } try { - return CloudError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + return ClusterZone.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; } catch { @@ -126,11 +127,11 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClou } if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) { - return CloudError.DeserializeFromPSObject(sourceValue); + return ClusterZone.DeserializeFromPSObject(sourceValue); } if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) { - return CloudError.DeserializeFromDictionary(sourceValue); + return ClusterZone.DeserializeFromDictionary(sourceValue); } return null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.cs new file mode 100644 index 000000000000..b6265197f3db --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.cs @@ -0,0 +1,80 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// Zone and associated hosts info + public partial class ClusterZone : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _host; + + /// List of hosts belonging to the availability zone in a cluster + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List Host { get => this._host; } + + /// Internal Acessors for Host + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal.Host { get => this._host; set { {_host = value;} } } + + /// Internal Acessors for Zone + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneInternal.Zone { get => this._zone; set { {_zone = value;} } } + + /// Backing field for property. + private string _zone; + + /// Availability zone identifier + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string Zone { get => this._zone; } + + /// Creates an new instance. + public ClusterZone() + { + + } + } + /// Zone and associated hosts info + public partial interface IClusterZone : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// List of hosts belonging to the availability zone in a cluster + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"List of hosts belonging to the availability zone in a cluster", + SerializedName = @"hosts", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List Host { get; } + /// Availability zone identifier + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Availability zone identifier", + SerializedName = @"zone", + PossibleTypes = new [] { typeof(string) })] + string Zone { get; } + + } + /// Zone and associated hosts info + internal partial interface IClusterZoneInternal + + { + /// List of hosts belonging to the availability zone in a cluster + System.Collections.Generic.List Host { get; set; } + /// Availability zone identifier + string Zone { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.json.cs new file mode 100644 index 000000000000..009b0aa51b64 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZone.json.cs @@ -0,0 +1,122 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// Zone and associated hosts info + public partial class ClusterZone + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterZone(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_host = If( json?.PropertyT("hosts"), out var __jsonHosts) ? If( __jsonHosts as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _host;} + {_zone = If( json?.PropertyT("zone"), out var __jsonZone) ? (string)__jsonZone : (string)_zone;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone. + /// + /// a to deserialize from. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ClusterZone(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._host) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(); + foreach( var __x in this._host ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("hosts",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._zone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._zone.ToString()) : null, "zone" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.PowerShell.cs new file mode 100644 index 000000000000..f1976f52bd46 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.PowerShell.cs @@ -0,0 +1,164 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// List of all zones and associated hosts for a cluster + [System.ComponentModel.TypeConverter(typeof(ClusterZoneListTypeConverter))] + public partial class ClusterZoneList + { + + /// + /// 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 a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ClusterZoneList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneListInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneListInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZoneTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClusterZoneList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Zone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneListInternal)this).Zone = (System.Collections.Generic.List) content.GetValueForProperty("Zone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneListInternal)this).Zone, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZoneTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// 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.VMware.Models.IClusterZoneList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterZoneList(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.VMware.Models.IClusterZoneList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterZoneList(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.VMware.Models.IClusterZoneList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 of all zones and associated hosts for a cluster + [System.ComponentModel.TypeConverter(typeof(ClusterZoneListTypeConverter))] + public partial interface IClusterZoneList + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.TypeConverter.cs new file mode 100644 index 000000000000..71d6ae695835 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ClusterZoneListTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ClusterZoneList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ClusterZoneList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ClusterZoneList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.cs new file mode 100644 index 000000000000..b0c05e47589d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.cs @@ -0,0 +1,54 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// List of all zones and associated hosts for a cluster + public partial class ClusterZoneList : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneListInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _zone; + + /// Zone and associated hosts info + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List Zone { get => this._zone; set => this._zone = value; } + + /// Creates an new instance. + public ClusterZoneList() + { + + } + } + /// List of all zones and associated hosts for a cluster + public partial interface IClusterZoneList : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// Zone and associated hosts info + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Zone and associated hosts info", + SerializedName = @"zones", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZone) })] + System.Collections.Generic.List Zone { get; set; } + + } + /// List of all zones and associated hosts for a cluster + internal partial interface IClusterZoneListInternal + + { + /// Zone and associated hosts info + System.Collections.Generic.List Zone { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.json.cs new file mode 100644 index 000000000000..0903c66f3324 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ClusterZoneList.json.cs @@ -0,0 +1,116 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// List of all zones and associated hosts for a cluster + public partial class ClusterZoneList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterZoneList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_zone = If( json?.PropertyT("zones"), out var __jsonZones) ? If( __jsonZones as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.IClusterZone) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZone.FromJson(__u) )) ))() : null : _zone;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ClusterZoneList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._zone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(); + foreach( var __x in this._zone ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("zones",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.PowerShell.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.PowerShell.cs index 604a51a7740f..0afee1017479 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CommonClusterProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,25 +78,25 @@ internal CommonClusterProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host, __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. @@ -111,45 +111,45 @@ internal CommonClusterProperties(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, 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.VMware.Models.Api20211201.ICommonClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CommonClusterProperties(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.VMware.Models.Api20211201.ICommonClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CommonClusterProperties(content); } @@ -159,7 +159,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IComm /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.TypeConverter.cs index 533e5f10ba3f..7a217820851b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICommonClusterProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.cs index f87459615889..e42fe0f383fa 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The common properties of a cluster public partial class CommonClusterProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal { /// Backing field for property. @@ -28,24 +28,24 @@ public partial class CommonClusterProperties : public int? ClusterSize { get => this._clusterSize; set => this._clusterSize = value; } /// Backing field for property. - private string[] _host; + private System.Collections.Generic.List _host; /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Host { get => this._host; set => this._host = value; } + public System.Collections.Generic.List Host { get => this._host; set => this._host = value; } /// Internal Acessors for ClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? _provisioningState; + private string _provisioningState; /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public CommonClusterProperties() @@ -61,6 +61,9 @@ public partial interface ICommonClusterProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity", SerializedName = @"clusterId", PossibleTypes = new [] { typeof(int) })] @@ -69,6 +72,9 @@ public partial interface ICommonClusterProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cluster size", SerializedName = @"clusterSize", PossibleTypes = new [] { typeof(int) })] @@ -77,18 +83,25 @@ public partial interface ICommonClusterProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the cluster provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } } /// The common properties of a cluster @@ -100,9 +113,10 @@ internal partial interface ICommonClusterPropertiesInternal /// The cluster size int? ClusterSize { get; set; } /// The hosts - string[] Host { get; set; } + System.Collections.Generic.List Host { get; set; } /// The state of the cluster provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.json.cs index 8a7a7cd7301f..869a6f8bc91e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CommonClusterProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/CommonClusterProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,21 @@ internal CommonClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runti { return; } - {_clusterSize = If( json?.PropertyT("clusterSize"), out var __jsonClusterSize) ? (int?)__jsonClusterSize : ClusterSize;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (int?)__jsonClusterId : ClusterId;} - {_host = If( json?.PropertyT("hosts"), out var __jsonHosts) ? If( __jsonHosts as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Host;} + {_clusterSize = If( json?.PropertyT("clusterSize"), out var __jsonClusterSize) ? (int?)__jsonClusterSize : _clusterSize;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (int?)__jsonClusterId : _clusterId;} + {_host = If( json?.PropertyT("hosts"), out var __jsonHosts) ? If( __jsonHosts as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _host;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new CommonClusterProperties(json) : null; } @@ -104,11 +104,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } AddIf( null != this._clusterSize ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNumber((int)this._clusterSize) : null, "clusterSize" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._clusterId ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNumber((int)this._clusterId) : null, "clusterId" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.PowerShell.cs similarity index 56% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Datastore.PowerShell.cs index 5db0e04bb5d4..6194bd96affd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class Datastore partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,61 +78,61 @@ internal Datastore(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastorePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastorePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("NetAppVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolumeTypeConverter.ConvertFrom); } if (content.Contains("DiskPoolVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolumeTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("NetAppVolumeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolumeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolumeId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeTargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeLunName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumePath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeMountOption")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeMountOption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum?) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeMountOption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeMountOption = (string) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeMountOption, 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. @@ -147,81 +147,81 @@ internal Datastore(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastorePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastorePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("NetAppVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolumeTypeConverter.ConvertFrom); } if (content.Contains("DiskPoolVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolumeTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("NetAppVolumeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).NetAppVolumeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).NetAppVolumeId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeTargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeLunName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumePath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeMountOption")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeMountOption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum?) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal)this).DiskPoolVolumeMountOption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeMountOption = (string) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal)this).DiskPoolVolumeMountOption, 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.VMware.Models.Api20211201.IDatastore DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Datastore(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.VMware.Models.Api20211201.IDatastore DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Datastore(content); } @@ -231,7 +231,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IData /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Datastore.TypeConverter.cs index 74485753cb8b..67765bd1833c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastore ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.cs b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.cs similarity index 58% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Datastore.cs index 66b238c5fb89..5b289ccd3136 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.cs @@ -3,98 +3,97 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A datastore resource public partial class Datastore : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// Name of the LUN to be used for datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public string DiskPoolVolumeLunName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumeLunName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumeLunName = value ?? null; } + public string DiskPoolVolumeLunName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumeLunName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumeLunName = value ?? null; } /// /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? DiskPoolVolumeMountOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumeMountOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumeMountOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum)""); } + public string DiskPoolVolumeMountOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumeMountOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumeMountOption = value ?? null; } /// Device path [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public string DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumePath; } + public string DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumePath; } /// Azure resource ID of the iSCSI target [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public string DiskPoolVolumeTargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumeTargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumeTargetId = value ?? null; } + public string DiskPoolVolumeTargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumeTargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumeTargetId = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for DiskPoolVolume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal.DiskPoolVolume { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolume; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolume = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal.DiskPoolVolume { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolume; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolume = value; } /// Internal Acessors for DiskPoolVolumePath - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal.DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).DiskPoolVolumePath = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal.DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumePath; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).DiskPoolVolumePath = value; } /// Internal Acessors for NetAppVolume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal.NetAppVolume { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).NetAppVolume; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).NetAppVolume = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal.NetAppVolume { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).NetAppVolume; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).NetAppVolume = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).Status = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.FormatTable(Index = 0)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Azure resource ID of the NetApp volume [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public string NetAppVolumeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).NetAppVolumeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).NetAppVolumeId = value ?? null; } + public string NetAppVolumeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).NetAppVolumeId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).NetAppVolumeId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties _property; /// The properties of a datastore resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreProperties()); set => this._property = value; } /// The state of the datastore provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.FormatTable(Index = 2)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -104,12 +103,12 @@ public partial class Datastore : /// The operational status of the datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.FormatTable(Index = 1)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)Property).Status; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.DoNotFormat] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public Datastore() @@ -132,12 +131,15 @@ public Datastore() /// A datastore resource public partial interface IDatastore : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// Name of the LUN to be used for datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the LUN to be used for datastore", SerializedName = @"lunName", PossibleTypes = new [] { typeof(string) })] @@ -148,14 +150,21 @@ public partial interface IDatastore : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", SerializedName = @"mountOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? DiskPoolVolumeMountOption { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + string DiskPoolVolumeMountOption { get; set; } /// Device path [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Device path", SerializedName = @"path", PossibleTypes = new [] { typeof(string) })] @@ -164,6 +173,9 @@ public partial interface IDatastore : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource ID of the iSCSI target", SerializedName = @"targetId", PossibleTypes = new [] { typeof(string) })] @@ -172,6 +184,9 @@ public partial interface IDatastore : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource ID of the NetApp volume", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -180,46 +195,57 @@ public partial interface IDatastore : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the datastore provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Creating", "Updating", "Deleting", "Canceled")] + string ProvisioningState { get; } /// The operational status of the datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The operational status of the datastore", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Unknown", "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", "DeadOrError")] + string Status { get; } } /// A datastore resource internal partial interface IDatastoreInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// An iSCSI volume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume DiskPoolVolume { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume DiskPoolVolume { get; set; } /// Name of the LUN to be used for datastore string DiskPoolVolumeLunName { get; set; } /// /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? DiskPoolVolumeMountOption { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + string DiskPoolVolumeMountOption { get; set; } /// Device path string DiskPoolVolumePath { get; set; } /// Azure resource ID of the iSCSI target string DiskPoolVolumeTargetId { get; set; } /// An Azure NetApp Files volume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume NetAppVolume { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume NetAppVolume { get; set; } /// Azure resource ID of the NetApp volume string NetAppVolumeId { get; set; } /// The properties of a datastore resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties Property { get; set; } /// The state of the datastore provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Creating", "Updating", "Deleting", "Canceled")] + string ProvisioningState { get; set; } /// The operational status of the datastore - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Unknown", "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", "DeadOrError")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Datastore.json.cs index 8ec12f8fd268..3e20d7e04943 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Datastore.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Datastore.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal Datastore(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonOb { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Datastore(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.PowerShell.cs index 39a201b74f74..37842d11595b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatastoreList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,17 +78,17 @@ internal DatastoreList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).NextLink, 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. @@ -103,37 +103,37 @@ internal DatastoreList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal)this).NextLink, 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.VMware.Models.Api20211201.IDatastoreList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatastoreList(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.VMware.Models.Api20211201.IDatastoreList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatastoreList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IData /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.TypeConverter.cs index 7b256cd8e3f9..d5d655b25c91 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastoreList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.cs index 7c218e9e28c4..1f1e288bb472 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of datastores public partial class DatastoreList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class DatastoreList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public DatastoreList() @@ -47,6 +47,9 @@ public partial interface IDatastoreList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IDatastoreList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore) })] + System.Collections.Generic.List Value { get; } } /// A paged list of datastores @@ -68,7 +74,7 @@ internal partial interface IDatastoreListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.json.cs index 54803e5c2232..11e5ca6cb923 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal DatastoreList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastore) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Datastore.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.VMware.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.VMware.Models.IDatastore) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new DatastoreList(json) : null; } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.PowerShell.cs similarity index 59% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.PowerShell.cs index d709bfe1327c..7f564d6bf89d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class DatastoreProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -78,45 +78,45 @@ internal DatastoreProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NetAppVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolumeTypeConverter.ConvertFrom); } if (content.Contains("DiskPoolVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolumeTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("NetAppVolumeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolumeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolumeId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeTargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeLunName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumePath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeMountOption")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum?) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption = (string) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption, 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. @@ -131,65 +131,65 @@ internal DatastoreProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("NetAppVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume) content.GetValueForProperty("NetAppVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolumeTypeConverter.ConvertFrom); } if (content.Contains("DiskPoolVolume")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolumeTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolume = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume) content.GetValueForProperty("DiskPoolVolume",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolume, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolumeTypeConverter.ConvertFrom); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("NetAppVolumeId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).NetAppVolumeId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolumeId = (string) content.GetValueForProperty("NetAppVolumeId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).NetAppVolumeId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeTargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId = (string) content.GetValueForProperty("DiskPoolVolumeTargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeTargetId, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeLunName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName = (string) content.GetValueForProperty("DiskPoolVolumeLunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeLunName, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumePath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumePath = (string) content.GetValueForProperty("DiskPoolVolumePath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumePath, global::System.Convert.ToString); } if (content.Contains("DiskPoolVolumeMountOption")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum?) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption = (string) content.GetValueForProperty("DiskPoolVolumeMountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal)this).DiskPoolVolumeMountOption, 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.VMware.Models.Api20211201.IDatastoreProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DatastoreProperties(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.VMware.Models.Api20211201.IDatastoreProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DatastoreProperties(content); } @@ -199,7 +199,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IData /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.TypeConverter.cs index 1fcf96faf81f..587a3e079fe8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastoreProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.cs similarity index 58% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.cs index 2d0619191e5d..7129e446f1b1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.cs @@ -3,80 +3,80 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a datastore public partial class DatastoreProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume _diskPoolVolume; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume _diskPoolVolume; /// An iSCSI volume [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume DiskPoolVolume { get => (this._diskPoolVolume = this._diskPoolVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolume()); set => this._diskPoolVolume = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume DiskPoolVolume { get => (this._diskPoolVolume = this._diskPoolVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolume()); set => this._diskPoolVolume = value; } /// Name of the LUN to be used for datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DiskPoolVolumeLunName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).LunName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).LunName = value ?? null; } + public string DiskPoolVolumeLunName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).LunName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).LunName = value ?? null; } /// /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? DiskPoolVolumeMountOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).MountOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).MountOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum)""); } + public string DiskPoolVolumeMountOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).MountOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).MountOption = value ?? null; } /// Device path [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).Path; } + public string DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).Path; } /// Azure resource ID of the iSCSI target [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DiskPoolVolumeTargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).TargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).TargetId = value ?? null; } + public string DiskPoolVolumeTargetId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).TargetId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).TargetId = value ?? null; } /// Internal Acessors for DiskPoolVolume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal.DiskPoolVolume { get => (this._diskPoolVolume = this._diskPoolVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolume()); set { {_diskPoolVolume = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal.DiskPoolVolume { get => (this._diskPoolVolume = this._diskPoolVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolume()); set { {_diskPoolVolume = value;} } } /// Internal Acessors for DiskPoolVolumePath - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal.DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)DiskPoolVolume).Path = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal.DiskPoolVolumePath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)DiskPoolVolume).Path = value; } /// Internal Acessors for NetAppVolume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal.NetAppVolume { get => (this._netAppVolume = this._netAppVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolume()); set { {_netAppVolume = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal.NetAppVolume { get => (this._netAppVolume = this._netAppVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolume()); set { {_netAppVolume = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastorePropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastorePropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume _netAppVolume; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume _netAppVolume; /// An Azure NetApp Files volume [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume NetAppVolume { get => (this._netAppVolume = this._netAppVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolume()); set => this._netAppVolume = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume NetAppVolume { get => (this._netAppVolume = this._netAppVolume ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolume()); set => this._netAppVolume = value; } /// Azure resource ID of the NetApp volume [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string NetAppVolumeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal)NetAppVolume).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal)NetAppVolume).Id = value ?? null; } + public string NetAppVolumeId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal)NetAppVolume).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal)NetAppVolume).Id = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? _provisioningState; + private string _provisioningState; /// The state of the datastore provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? _status; + private string _status; /// The operational status of the datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public DatastoreProperties() @@ -92,6 +92,9 @@ public partial interface IDatastoreProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the LUN to be used for datastore", SerializedName = @"lunName", PossibleTypes = new [] { typeof(string) })] @@ -102,14 +105,21 @@ public partial interface IDatastoreProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", SerializedName = @"mountOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? DiskPoolVolumeMountOption { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + string DiskPoolVolumeMountOption { get; set; } /// Device path [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Device path", SerializedName = @"path", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +128,9 @@ public partial interface IDatastoreProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource ID of the iSCSI target", SerializedName = @"targetId", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +139,9 @@ public partial interface IDatastoreProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource ID of the NetApp volume", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -134,18 +150,26 @@ public partial interface IDatastoreProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the datastore provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Creating", "Updating", "Deleting", "Canceled")] + string ProvisioningState { get; } /// The operational status of the datastore [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The operational status of the datastore", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Unknown", "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", "DeadOrError")] + string Status { get; } } /// The properties of a datastore @@ -153,25 +177,28 @@ internal partial interface IDatastorePropertiesInternal { /// An iSCSI volume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume DiskPoolVolume { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume DiskPoolVolume { get; set; } /// Name of the LUN to be used for datastore string DiskPoolVolumeLunName { get; set; } /// /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? DiskPoolVolumeMountOption { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + string DiskPoolVolumeMountOption { get; set; } /// Device path string DiskPoolVolumePath { get; set; } /// Azure resource ID of the iSCSI target string DiskPoolVolumeTargetId { get; set; } /// An Azure NetApp Files volume - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume NetAppVolume { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume NetAppVolume { get; set; } /// Azure resource ID of the NetApp volume string NetAppVolumeId { get; set; } /// The state of the datastore provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Creating", "Updating", "Deleting", "Canceled")] + string ProvisioningState { get; set; } /// The operational status of the datastore - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Unknown", "Accessible", "Inaccessible", "Attached", "Detached", "LostCommunication", "DeadOrError")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.json.cs index 6844f640b78b..d8f1ae1e727a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DatastoreProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DatastoreProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,21 @@ internal DatastoreProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - {_netAppVolume = If( json?.PropertyT("netAppVolume"), out var __jsonNetAppVolume) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.NetAppVolume.FromJson(__jsonNetAppVolume) : NetAppVolume;} - {_diskPoolVolume = If( json?.PropertyT("diskPoolVolume"), out var __jsonDiskPoolVolume) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DiskPoolVolume.FromJson(__jsonDiskPoolVolume) : DiskPoolVolume;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_netAppVolume = If( json?.PropertyT("netAppVolume"), out var __jsonNetAppVolume) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.NetAppVolume.FromJson(__jsonNetAppVolume) : _netAppVolume;} + {_diskPoolVolume = If( json?.PropertyT("diskPoolVolume"), out var __jsonDiskPoolVolume) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DiskPoolVolume.FromJson(__jsonDiskPoolVolume) : _diskPoolVolume;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastoreProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new DatastoreProperties(json) : null; } @@ -105,11 +105,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } AddIf( null != this._netAppVolume ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._netAppVolume.ToJson(null,serializationMode) : null, "netAppVolume" ,container.Add ); AddIf( null != this._diskPoolVolume ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._diskPoolVolume.ToJson(null,serializationMode) : null, "diskPoolVolume" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.PowerShell.cs similarity index 74% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.PowerShell.cs index 0db1c8a5ae21..7a0c8bff95c0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class DiskPoolVolume partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IDiskPoolVolume DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DiskPoolVolume(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.VMware.Models.Api20211201.IDiskPoolVolume DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DiskPoolVolume(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,25 +104,25 @@ internal DiskPoolVolume(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("TargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).TargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).TargetId, global::System.Convert.ToString); } if (content.Contains("LunName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).LunName = (string) content.GetValueForProperty("LunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).LunName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).LunName = (string) content.GetValueForProperty("LunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).LunName, global::System.Convert.ToString); } if (content.Contains("MountOption")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).MountOption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum?) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).MountOption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).MountOption = (string) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).MountOption, global::System.Convert.ToString); } if (content.Contains("Path")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).Path, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).Path, 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. @@ -137,19 +137,19 @@ internal DiskPoolVolume(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("TargetId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).TargetId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).TargetId = (string) content.GetValueForProperty("TargetId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).TargetId, global::System.Convert.ToString); } if (content.Contains("LunName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).LunName = (string) content.GetValueForProperty("LunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).LunName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).LunName = (string) content.GetValueForProperty("LunName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).LunName, global::System.Convert.ToString); } if (content.Contains("MountOption")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).MountOption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum?) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).MountOption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).MountOption = (string) content.GetValueForProperty("MountOption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).MountOption, global::System.Convert.ToString); } if (content.Contains("Path")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal)this).Path, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal)this).Path, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,7 +159,7 @@ internal DiskPoolVolume(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.VMware.Models.Api20211201.IDiskPoolVolume FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.TypeConverter.cs index 113f714da9f8..e8b24633bb85 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDiskPoolVolume ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.cs b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.cs similarity index 81% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.cs index fef7f8181b8d..70cec65fe793 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An iSCSI volume from Microsoft.StoragePool provider public partial class DiskPoolVolume : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal { /// Backing field for property. @@ -21,16 +21,16 @@ public partial class DiskPoolVolume : public string LunName { get => this._lunName; set => this._lunName = value; } /// Internal Acessors for Path - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolumeInternal.Path { get => this._path; set { {_path = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolumeInternal.Path { get => this._path; set { {_path = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? _mountOption; + private string _mountOption; /// /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? MountOption { get => this._mountOption; set => this._mountOption = value; } + public string MountOption { get => this._mountOption; set => this._mountOption = value; } /// Backing field for property. private string _path; @@ -60,6 +60,9 @@ public partial interface IDiskPoolVolume : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the LUN to be used for datastore", SerializedName = @"lunName", PossibleTypes = new [] { typeof(string) })] @@ -70,14 +73,21 @@ public partial interface IDiskPoolVolume : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", SerializedName = @"mountOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? MountOption { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + string MountOption { get; set; } /// Device path [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Device path", SerializedName = @"path", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +96,9 @@ public partial interface IDiskPoolVolume : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource ID of the iSCSI target", SerializedName = @"targetId", PossibleTypes = new [] { typeof(string) })] @@ -101,7 +114,8 @@ internal partial interface IDiskPoolVolumeInternal /// /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum? MountOption { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + string MountOption { get; set; } /// Device path string Path { get; set; } /// Azure resource ID of the iSCSI target diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.json.cs index bbbd160b1b16..bdfbcdc3f349 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/DiskPoolVolume.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/DiskPoolVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,21 @@ internal DiskPoolVolume(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.J { return; } - {_targetId = If( json?.PropertyT("targetId"), out var __jsonTargetId) ? (string)__jsonTargetId : (string)TargetId;} - {_lunName = If( json?.PropertyT("lunName"), out var __jsonLunName) ? (string)__jsonLunName : (string)LunName;} - {_mountOption = If( json?.PropertyT("mountOption"), out var __jsonMountOption) ? (string)__jsonMountOption : (string)MountOption;} - {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_targetId = If( json?.PropertyT("targetId"), out var __jsonTargetId) ? (string)__jsonTargetId : (string)_targetId;} + {_lunName = If( json?.PropertyT("lunName"), out var __jsonLunName) ? (string)__jsonLunName : (string)_lunName;} + {_mountOption = If( json?.PropertyT("mountOption"), out var __jsonMountOption) ? (string)__jsonMountOption : (string)_mountOption;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)_path;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDiskPoolVolume FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDiskPoolVolume FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new DiskPoolVolume(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi AddIf( null != (((object)this._targetId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._targetId.ToString()) : null, "targetId" ,container.Add ); AddIf( null != (((object)this._lunName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._lunName.ToString()) : null, "lunName" ,container.Add ); AddIf( null != (((object)this._mountOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._mountOption.ToString()) : null, "mountOption" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.PowerShell.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Encryption.PowerShell.cs index 33bcde445390..9806b8615846 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class Encryption partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IEncryption DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Encryption(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.VMware.Models.Api20211201.IEncryption DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Encryption(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,37 +104,41 @@ internal Encryption(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("KeyVaultProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyVaultUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyVersionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyVersionType, 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. @@ -149,31 +153,35 @@ internal Encryption(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("KeyVaultProperty")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyVaultUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyKeyState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyKeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); } if (content.Contains("KeyVaultPropertyVersionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyVersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionInternal)this).KeyVaultPropertyVersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)this).KeyVaultPropertyVersionType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -183,7 +191,7 @@ internal Encryption(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.VMware.Models.Api20211201.IEncryption FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Encryption.TypeConverter.cs index 8f94a47c95d1..1585c75aaf40 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IEncryption ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Encryption.cs b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.cs new file mode 100644 index 000000000000..d4a6cd0ce0c9 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.cs @@ -0,0 +1,183 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// The properties of customer managed encryption key + public partial class Encryption : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties _keyVaultProperty; + + /// The key vault where the encryption key is stored + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultProperties()); set => this._keyVaultProperty = value; } + + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).AutoDetectedKeyVersion; } + + /// The name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyName = value ?? null; } + + /// The state of key provided + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyState; } + + /// The URL of the vault. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUrl = value ?? null; } + + /// The version of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion = value ?? null; } + + /// Property of the key if user provided or auto detected + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).VersionType; } + + /// Internal Acessors for KeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal.KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultProperties()); set { {_keyVaultProperty = value;} } } + + /// Internal Acessors for KeyVaultPropertyAutoDetectedKeyVersion + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal.KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).AutoDetectedKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).AutoDetectedKeyVersion = value; } + + /// Internal Acessors for KeyVaultPropertyKeyState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).KeyState = value; } + + /// Internal Acessors for KeyVaultPropertyVersionType + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).VersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)KeyVaultProperty).VersionType = value; } + + /// Backing field for property. + private string _status; + + /// Status of customer managed encryption key + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public Encryption() + { + + } + } + /// The properties of customer managed encryption key + public partial interface IEncryption : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The auto-detected version of the key if versionType is auto-detected.", + SerializedName = @"autoDetectedKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyAutoDetectedKeyVersion { get; } + /// The name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the key.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyName { get; set; } + /// The state of key provided + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The state of key provided", + SerializedName = @"keyState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; } + /// The URL of the vault. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the vault.", + SerializedName = @"keyVaultUrl", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVaultUrl { get; set; } + /// The version of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The version of the key.", + SerializedName = @"keyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVersion { get; set; } + /// Property of the key if user provided or auto detected + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Property of the key if user provided or auto detected", + SerializedName = @"versionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; } + /// Status of customer managed encryption key + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Status of customer managed encryption key", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Status { get; set; } + + } + /// The properties of customer managed encryption key + internal partial interface IEncryptionInternal + + { + /// The key vault where the encryption key is stored + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties KeyVaultProperty { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + string KeyVaultPropertyAutoDetectedKeyVersion { get; set; } + /// The name of the key. + string KeyVaultPropertyKeyName { get; set; } + /// The state of key provided + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; set; } + /// The URL of the vault. + string KeyVaultPropertyKeyVaultUrl { get; set; } + /// The version of the key. + string KeyVaultPropertyKeyVersion { get; set; } + /// Property of the key if user provided or auto detected + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; set; } + /// Status of customer managed encryption key + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Status { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Encryption.json.cs index 1f18054909ea..0a552dcb8eaa 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Encryption.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Encryption.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,17 @@ internal Encryption(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonO { return; } - {_keyVaultProperty = If( json?.PropertyT("keyVaultProperties"), out var __jsonKeyVaultProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.EncryptionKeyVaultProperties.FromJson(__jsonKeyVaultProperties) : KeyVaultProperty;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_keyVaultProperty = If( json?.PropertyT("keyVaultProperties"), out var __jsonKeyVaultProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultProperties.FromJson(__jsonKeyVaultProperties) : _keyVaultProperty;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Encryption(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.PowerShell.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.PowerShell.cs index d6483bf9a5e9..91904bb29f0d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class EncryptionKeyVaultProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IEncryptionKeyVaultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EncryptionKeyVaultProperties(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.VMware.Models.Api20211201.IEncryptionKeyVaultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EncryptionKeyVaultProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,29 +104,33 @@ internal EncryptionKeyVaultProperties(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("KeyName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); } if (content.Contains("KeyVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + } + if (content.Contains("AutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).AutoDetectedKeyVersion = (string) content.GetValueForProperty("AutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).AutoDetectedKeyVersion, global::System.Convert.ToString); } if (content.Contains("KeyVaultUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl, global::System.Convert.ToString); } if (content.Contains("KeyState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyState = (string) content.GetValueForProperty("KeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyState, global::System.Convert.ToString); } if (content.Contains("VersionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).VersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("VersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).VersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).VersionType = (string) content.GetValueForProperty("VersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).VersionType, 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. @@ -143,23 +145,27 @@ internal EncryptionKeyVaultProperties(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("KeyName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); } if (content.Contains("KeyVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + } + if (content.Contains("AutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).AutoDetectedKeyVersion = (string) content.GetValueForProperty("AutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).AutoDetectedKeyVersion, global::System.Convert.ToString); } if (content.Contains("KeyVaultUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl = (string) content.GetValueForProperty("KeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyVaultUrl, global::System.Convert.ToString); } if (content.Contains("KeyState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus?) content.GetValueForProperty("KeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).KeyState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyState = (string) content.GetValueForProperty("KeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).KeyState, global::System.Convert.ToString); } if (content.Contains("VersionType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).VersionType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType?) content.GetValueForProperty("VersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal)this).VersionType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).VersionType = (string) content.GetValueForProperty("VersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal)this).VersionType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -169,7 +175,7 @@ internal EncryptionKeyVaultProperties(global::System.Management.Automation.PSObj /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.TypeConverter.cs index aa95c54dfb1d..cf675ef9a548 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IEncryptionKeyVaultProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.cs similarity index 59% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.cs index f4e8cf16de40..0de777e24772 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.cs @@ -3,16 +3,23 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An Encryption Key public partial class EncryptionKeyVaultProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal { + /// Backing field for property. + private string _autoDetectedKeyVersion; + + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string AutoDetectedKeyVersion { get => this._autoDetectedKeyVersion; } + /// Backing field for property. private string _keyName; @@ -21,11 +28,11 @@ public partial class EncryptionKeyVaultProperties : public string KeyName { get => this._keyName; set => this._keyName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? _keyState; + private string _keyState; /// The state of key provided [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyState { get => this._keyState; } + public string KeyState { get => this._keyState; } /// Backing field for property. private string _keyVaultUrl; @@ -41,18 +48,21 @@ public partial class EncryptionKeyVaultProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] public string KeyVersion { get => this._keyVersion; set => this._keyVersion = value; } + /// Internal Acessors for AutoDetectedKeyVersion + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal.AutoDetectedKeyVersion { get => this._autoDetectedKeyVersion; set { {_autoDetectedKeyVersion = value;} } } + /// Internal Acessors for KeyState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal.KeyState { get => this._keyState; set { {_keyState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal.KeyState { get => this._keyState; set { {_keyState = value;} } } /// Internal Acessors for VersionType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultPropertiesInternal.VersionType { get => this._versionType; set { {_versionType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultPropertiesInternal.VersionType { get => this._versionType; set { {_versionType = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? _versionType; + private string _versionType; /// Property of the key if user provided or auto detected [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? VersionType { get => this._versionType; } + public string VersionType { get => this._versionType; } /// Creates an new instance. public EncryptionKeyVaultProperties() @@ -64,10 +74,24 @@ public EncryptionKeyVaultProperties() public partial interface IEncryptionKeyVaultProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable { + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The auto-detected version of the key if versionType is auto-detected.", + SerializedName = @"autoDetectedKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string AutoDetectedKeyVersion { get; } /// The name of the key. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the key.", SerializedName = @"keyName", PossibleTypes = new [] { typeof(string) })] @@ -76,14 +100,21 @@ public partial interface IEncryptionKeyVaultProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of key provided", SerializedName = @"keyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyState { get; } /// The URL of the vault. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL of the vault.", SerializedName = @"keyVaultUrl", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +123,9 @@ public partial interface IEncryptionKeyVaultProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The version of the key.", SerializedName = @"keyVersion", PossibleTypes = new [] { typeof(string) })] @@ -100,26 +134,34 @@ public partial interface IEncryptionKeyVaultProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Property of the key if user provided or auto detected", SerializedName = @"versionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? VersionType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string VersionType { get; } } /// An Encryption Key internal partial interface IEncryptionKeyVaultPropertiesInternal { + /// The auto-detected version of the key if versionType is auto-detected. + string AutoDetectedKeyVersion { get; set; } /// The name of the key. string KeyName { get; set; } /// The state of key provided - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyState { get; set; } /// The URL of the vault. string KeyVaultUrl { get; set; } /// The version of the key. string KeyVersion { get; set; } /// Property of the key if user provided or auto detected - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? VersionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string VersionType { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.json.cs similarity index 86% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.json.cs index 1a091cc6d222..5c64464db9f3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/EncryptionKeyVaultProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/EncryptionKeyVaultProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,22 +65,23 @@ internal EncryptionKeyVaultProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware. { return; } - {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} - {_keyVersion = If( json?.PropertyT("keyVersion"), out var __jsonKeyVersion) ? (string)__jsonKeyVersion : (string)KeyVersion;} - {_keyVaultUrl = If( json?.PropertyT("keyVaultUrl"), out var __jsonKeyVaultUrl) ? (string)__jsonKeyVaultUrl : (string)KeyVaultUrl;} - {_keyState = If( json?.PropertyT("keyState"), out var __jsonKeyState) ? (string)__jsonKeyState : (string)KeyState;} - {_versionType = If( json?.PropertyT("versionType"), out var __jsonVersionType) ? (string)__jsonVersionType : (string)VersionType;} + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)_keyName;} + {_keyVersion = If( json?.PropertyT("keyVersion"), out var __jsonKeyVersion) ? (string)__jsonKeyVersion : (string)_keyVersion;} + {_autoDetectedKeyVersion = If( json?.PropertyT("autoDetectedKeyVersion"), out var __jsonAutoDetectedKeyVersion) ? (string)__jsonAutoDetectedKeyVersion : (string)_autoDetectedKeyVersion;} + {_keyVaultUrl = If( json?.PropertyT("keyVaultUrl"), out var __jsonKeyVaultUrl) ? (string)__jsonKeyVaultUrl : (string)_keyVaultUrl;} + {_keyState = If( json?.PropertyT("keyState"), out var __jsonKeyState) ? (string)__jsonKeyState : (string)_keyState;} + {_versionType = If( json?.PropertyT("versionType"), out var __jsonVersionType) ? (string)__jsonVersionType : (string)_versionType;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new EncryptionKeyVaultProperties(json) : null; } @@ -106,12 +107,16 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); AddIf( null != (((object)this._keyVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._keyVersion.ToString()) : null, "keyVersion" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._autoDetectedKeyVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._autoDetectedKeyVersion.ToString()) : null, "autoDetectedKeyVersion" ,container.Add ); + } AddIf( null != (((object)this._keyVaultUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._keyVaultUrl.ToString()) : null, "keyVaultUrl" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._keyState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._keyState.ToString()) : null, "keyState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._versionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._versionType.ToString()) : null, "versionType" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Endpoints.PowerShell.cs index ac6c5afd571c..7a883c1bea82 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class Endpoints partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IEndpoints DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Endpoints(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.VMware.Models.Api20211201.IEndpoints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Endpoints(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,21 +104,21 @@ internal Endpoints(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NsxtManager")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).NsxtManager = (string) content.GetValueForProperty("NsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).NsxtManager, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).NsxtManager = (string) content.GetValueForProperty("NsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).NsxtManager, global::System.Convert.ToString); } if (content.Contains("Vcsa")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).Vcsa = (string) content.GetValueForProperty("Vcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).Vcsa, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).Vcsa = (string) content.GetValueForProperty("Vcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).Vcsa, global::System.Convert.ToString); } if (content.Contains("HcxCloudManager")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).HcxCloudManager = (string) content.GetValueForProperty("HcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).HcxCloudManager, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).HcxCloudManager = (string) content.GetValueForProperty("HcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).HcxCloudManager, 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. @@ -133,15 +133,15 @@ internal Endpoints(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NsxtManager")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).NsxtManager = (string) content.GetValueForProperty("NsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).NsxtManager, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).NsxtManager = (string) content.GetValueForProperty("NsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).NsxtManager, global::System.Convert.ToString); } if (content.Contains("Vcsa")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).Vcsa = (string) content.GetValueForProperty("Vcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).Vcsa, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).Vcsa = (string) content.GetValueForProperty("Vcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).Vcsa, global::System.Convert.ToString); } if (content.Contains("HcxCloudManager")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).HcxCloudManager = (string) content.GetValueForProperty("HcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)this).HcxCloudManager, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).HcxCloudManager = (string) content.GetValueForProperty("HcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)this).HcxCloudManager, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -151,7 +151,7 @@ internal Endpoints(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.VMware.Models.Api20211201.IEndpoints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Endpoints.TypeConverter.cs index 790453ebcfc0..ce9a65c22fbd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IEndpoints ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.cs b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.cs similarity index 85% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Endpoints.cs index 1301e5cf2caf..ff43f051b0fb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Endpoint addresses public partial class Endpoints : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal { /// Backing field for property. @@ -21,13 +21,13 @@ public partial class Endpoints : public string HcxCloudManager { get => this._hcxCloudManager; } /// Internal Acessors for HcxCloudManager - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal.HcxCloudManager { get => this._hcxCloudManager; set { {_hcxCloudManager = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal.HcxCloudManager { get => this._hcxCloudManager; set { {_hcxCloudManager = value;} } } /// Internal Acessors for NsxtManager - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal.NsxtManager { get => this._nsxtManager; set { {_nsxtManager = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal.NsxtManager { get => this._nsxtManager; set { {_nsxtManager = value;} } } /// Internal Acessors for Vcsa - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal.Vcsa { get => this._vcsa; set { {_vcsa = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal.Vcsa { get => this._vcsa; set { {_vcsa = value;} } } /// Backing field for property. private string _nsxtManager; @@ -57,6 +57,9 @@ public partial interface IEndpoints : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for the HCX Cloud Manager", SerializedName = @"hcxCloudManager", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IEndpoints : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for the NSX-T Data Center manager", SerializedName = @"nsxtManager", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IEndpoints : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for Virtual Center Server Appliance", SerializedName = @"vcsa", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Endpoints.json.cs index 0868585d2eb2..772fd968e02f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Endpoints.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Endpoints.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,20 +65,18 @@ internal Endpoints(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonOb { return; } - {_nsxtManager = If( json?.PropertyT("nsxtManager"), out var __jsonNsxtManager) ? (string)__jsonNsxtManager : (string)NsxtManager;} - {_vcsa = If( json?.PropertyT("vcsa"), out var __jsonVcsa) ? (string)__jsonVcsa : (string)Vcsa;} - {_hcxCloudManager = If( json?.PropertyT("hcxCloudManager"), out var __jsonHcxCloudManager) ? (string)__jsonHcxCloudManager : (string)HcxCloudManager;} + {_nsxtManager = If( json?.PropertyT("nsxtManager"), out var __jsonNsxtManager) ? (string)__jsonNsxtManager : (string)_nsxtManager;} + {_vcsa = If( json?.PropertyT("vcsa"), out var __jsonVcsa) ? (string)__jsonVcsa : (string)_vcsa;} + {_hcxCloudManager = If( json?.PropertyT("hcxCloudManager"), out var __jsonHcxCloudManager) ? (string)__jsonHcxCloudManager : (string)_hcxCloudManager;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Endpoints(json) : null; } @@ -102,15 +100,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nsxtManager)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nsxtManager.ToString()) : null, "nsxtManager" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vcsa)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vcsa.ToString()) : null, "vcsa" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._hcxCloudManager)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._hcxCloudManager.ToString()) : null, "hcxCloudManager" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 80% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index a252b708c829..0560825ce909 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ErrorAdditionalInfo partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api10.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorAdditionalInfo(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.VMware.Models.Api10.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorAdditionalInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,17 +104,17 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -129,11 +129,11 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -143,7 +143,7 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index e68722a0d1b6..93891e1818cb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api10.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 82% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index 4ed7d4cefbe7..29f38cc0d86f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _type; @@ -47,6 +47,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info.", SerializedName = @"info", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index d2a500fc3d59..c9d4cbbd7a6a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorAdditionalInfo.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorAdditionalInfo.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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Any.FromJson(__jsonInfo) : Info;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs new file mode 100644 index 000000000000..e0537a0dba58 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs @@ -0,0 +1,196 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// The error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial class ErrorDetail + { + + /// + /// 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.VMware.Models.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorDetail(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.VMware.Models.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorDetail(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorDetail(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorDetail(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(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.VMware.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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(); + } + } + /// The error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial interface IErrorDetail + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs new file mode 100644 index 000000000000..268bf4e0e64e --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorDetailTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorDetail.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorDetail.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.cs similarity index 62% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.cs index 25225d6259b9..6b4838e8ad72 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.cs @@ -3,25 +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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.) - /// - public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal + /// The error detail. + public partial class ErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] _additionalInfo; + private System.Collections.Generic.List _additionalInfo; /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } + public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } /// Backing field for property. private string _code; @@ -31,11 +28,11 @@ public partial class ErrorResponse : public string Code { get => this._code; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] _detail; + private System.Collections.Generic.List _detail; /// The error details. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Detail { get => this._detail; } + public System.Collections.Generic.List Detail { get => this._detail; } /// Backing field for property. private string _message; @@ -45,19 +42,19 @@ public partial class ErrorResponse : public string Message { get => this._message; } /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal.Code { get => this._code; set { {_code = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal.Detail { get => this._detail; set { {_detail = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal.Target { get => this._target; set { {_target = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } /// Backing field for property. private string _target; @@ -66,29 +63,34 @@ public partial class ErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] public string Target { get => this._target; } - /// Creates an new instance. - public ErrorResponse() + /// Creates an new instance. + public ErrorDetail() { } } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.) - public partial interface IErrorResponse : + /// The error detail. + public partial interface IErrorDetail : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable { /// The error additional info. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error additional info.", SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } /// The error code. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -97,14 +99,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error details.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Detail { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } /// The error message. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -113,23 +121,25 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] string Target { get; } } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.) - internal partial interface IErrorResponseInternal + /// The error detail. + internal partial interface IErrorDetailInternal { /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[] AdditionalInfo { get; set; } + System.Collections.Generic.List AdditionalInfo { get; set; } /// The error code. string Code { get; set; } /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// The error message. string Message { get; set; } /// The error target. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.json.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.json.cs index f9eca334c361..b94e45d35bc1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorDetail.json.cs @@ -3,15 +3,12 @@ // 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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.) - /// - public partial class ErrorResponse + /// The error detail. + public partial class ErrorDetail { /// @@ -57,10 +54,10 @@ public partial class ErrorResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. - internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -68,34 +65,32 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { 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.VMware.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.VMware.Models.Api10.IErrorResponse) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponse.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + {_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.VMware.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.VMware.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) { @@ -107,19 +102,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -131,7 +126,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 40f2fb55b66e..891e6fac5e8b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; /// /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.) + /// the OData error response format.). /// [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] public partial class ErrorResponse @@ -66,33 +66,33 @@ public partial class ErrorResponse partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api10.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api10.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -105,31 +105,35 @@ internal ErrorResponse(global::System.Collections.IDictionary content) return; } // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetailTypeConverter.ConvertFrom); + } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorAdditionalInfoTypeConverter.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. @@ -142,25 +146,29 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) return; } // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetailTypeConverter.ConvertFrom); + } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetailTypeConverter.ConvertFrom)); } if (content.Contains("AdditionalInfo")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -170,7 +178,7 @@ 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.VMware.Models.Api10.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -190,7 +198,7 @@ public override string ToString() } } /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.) + /// the OData error response format.). [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] public partial interface IErrorResponse diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 0129f46f6663..32de758161da 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api10/ErrorResponse.TypeConverter.cs +++ b/src/VMware/VMware.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.VMware.Models.Api10 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api10.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.cs new file mode 100644 index 000000000000..4007f5cad142 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.cs @@ -0,0 +1,151 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetail()); set => this._error = value; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).AdditionalInfo = value; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Code = value; } + + /// Internal Acessors for Detail + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Detail = value; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Message = value; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Target = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetailInternal)Error).Target; } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + internal partial interface IErrorResponseInternal + + { + /// The error additional info. + System.Collections.Generic.List AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + System.Collections.Generic.List Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorDetail Error { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 81% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.json.cs index f6174dd9668c..eddd60db648e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/CloudError.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,12 +3,15 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; - /// API error response - public partial class CloudError + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponse { /// @@ -54,10 +57,10 @@ public partial class CloudError partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . /// /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. - internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) { bool returnNow = false; BeforeFromJson(json, ref returnNow); @@ -65,30 +68,28 @@ internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonO { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api10.ErrorResponse.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorDetail.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudError. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { - return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new CloudError(json) : null; + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } /// - /// Serializes this instance of into a . + /// Serializes this instance of into a . /// /// The container to serialize this object into. If the caller /// passes in null, a new instance will be created and returned to the caller. /// Allows the caller to choose the depth of the serialization. See . /// - /// a serialized instance of as a . + /// a serialized instance of as a . /// public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) { diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.PowerShell.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.PowerShell.cs index 29d62a88ba12..70c20620ce54 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ExpressRouteAuthorization partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IExpressRouteAuthorization DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpressRouteAuthorization(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.VMware.Models.Api20211201.IExpressRouteAuthorization DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpressRouteAuthorization(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,41 +104,41 @@ internal ExpressRouteAuthorization(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ExpressRouteAuthorizationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteId, 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. @@ -153,35 +153,35 @@ internal ExpressRouteAuthorization(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ExpressRouteAuthorizationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); } if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal)this).ExpressRouteId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -191,7 +191,7 @@ internal ExpressRouteAuthorization(global::System.Management.Automation.PSObject /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.TypeConverter.cs index 5b6444446960..c24929c481b1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorization ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.cs index d314556f2f82..244da131dfb2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.cs @@ -3,73 +3,72 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// ExpressRoute Circuit Authorization public partial class ExpressRouteAuthorization : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// The ID of the ExpressRoute Circuit Authorization [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ExpressRouteAuthorizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationId; } + public string ExpressRouteAuthorizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationId; } /// The ID of the ExpressRoute Circuit [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteId = value ?? null; } + public string ExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteId = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// The key of the ExpressRoute Circuit Authorization [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationKey; } + public string Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationKey; } /// Internal Acessors for ExpressRouteAuthorizationId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal.ExpressRouteAuthorizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal.ExpressRouteAuthorizationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationId = value; } /// Internal Acessors for Key - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal.Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationKey = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal.Key { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ExpressRouteAuthorizationKey = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties _property; /// The properties of an ExpressRoute Circuit Authorization resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationProperties()); } /// The state of the ExpressRoute Circuit Authorization provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -77,7 +76,7 @@ public partial class ExpressRouteAuthorization : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ExpressRouteAuthorization() @@ -100,12 +99,15 @@ public ExpressRouteAuthorization() /// ExpressRoute Circuit Authorization public partial interface IExpressRouteAuthorization : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// The ID of the ExpressRoute Circuit Authorization [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ID of the ExpressRoute Circuit Authorization", SerializedName = @"expressRouteAuthorizationId", PossibleTypes = new [] { typeof(string) })] @@ -113,15 +115,21 @@ public partial interface IExpressRouteAuthorization : /// The ID of the ExpressRoute Circuit [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ID of the ExpressRoute Circuit", SerializedName = @"expressRouteId", PossibleTypes = new [] { typeof(string) })] - string ExpressRouteId { get; set; } + string ExpressRouteId { get; } /// The key of the ExpressRoute Circuit Authorization [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The key of the ExpressRoute Circuit Authorization", SerializedName = @"expressRouteAuthorizationKey", PossibleTypes = new [] { typeof(string) })] @@ -130,15 +138,19 @@ public partial interface IExpressRouteAuthorization : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the ExpressRoute Circuit Authorization provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; } } /// ExpressRoute Circuit Authorization internal partial interface IExpressRouteAuthorizationInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// The ID of the ExpressRoute Circuit Authorization string ExpressRouteAuthorizationId { get; set; } @@ -147,9 +159,10 @@ internal partial interface IExpressRouteAuthorizationInternal : /// The key of the ExpressRoute Circuit Authorization string Key { get; set; } /// The properties of an ExpressRoute Circuit Authorization resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties Property { get; set; } /// The state of the ExpressRoute Circuit Authorization provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.json.cs index 2d0fb128a7c6..ce2c18553d56 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorization.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorization.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExpressRouteAuthorization(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ExpressRouteAuthorization(json) : null; } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } __resource?.ToJson(container, serializationMode); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.PowerShell.cs index 52ca3c641a31..3347e69811bd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ExpressRouteAuthorizationList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IExpressRouteAuthorizationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpressRouteAuthorizationList(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.VMware.Models.Api20211201.IExpressRouteAuthorizationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpressRouteAuthorizationList(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,17 +104,17 @@ internal ExpressRouteAuthorizationList(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).NextLink, 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. @@ -131,11 +129,11 @@ internal ExpressRouteAuthorizationList(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,7 +143,7 @@ internal ExpressRouteAuthorizationList(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.VMware.Models.Api20211201.IExpressRouteAuthorizationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.TypeConverter.cs index a8b597123be6..8549374ae178 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorizationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.cs index 3dc7faa6cd4e..7da17470ddb8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of ExpressRoute Circuit Authorizations public partial class ExpressRouteAuthorizationList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ExpressRouteAuthorizationList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ExpressRouteAuthorizationList() @@ -47,6 +47,9 @@ public partial interface IExpressRouteAuthorizationList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IExpressRouteAuthorizationList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization) })] + System.Collections.Generic.List Value { get; } } /// A paged list of ExpressRoute Circuit Authorizations @@ -68,7 +74,7 @@ internal partial interface IExpressRouteAuthorizationListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.json.cs index fb4df06437e7..e7f19d4cc13e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExpressRouteAuthorizationList(Microsoft.Azure.PowerShell.Cmdlets.VMware { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorization) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorization.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.VMware.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.VMware.Models.IExpressRouteAuthorization) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ExpressRouteAuthorizationList(json) : null; } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.PowerShell.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.PowerShell.cs index 422b0b3c49f9..9dfa7f1b74ee 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,35 +63,33 @@ public partial class ExpressRouteAuthorizationProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExpressRouteAuthorizationProperties(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.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExpressRouteAuthorizationProperties(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -106,25 +104,25 @@ internal ExpressRouteAuthorizationProperties(global::System.Collections.IDiction // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ExpressRouteAuthorizationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); } if (content.Contains("ExpressRouteAuthorizationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey = (string) content.GetValueForProperty("ExpressRouteAuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey = (string) content.GetValueForProperty("ExpressRouteAuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId, 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. @@ -139,19 +137,19 @@ internal ExpressRouteAuthorizationProperties(global::System.Management.Automatio // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ExpressRouteAuthorizationId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId = (string) content.GetValueForProperty("ExpressRouteAuthorizationId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationId, global::System.Convert.ToString); } if (content.Contains("ExpressRouteAuthorizationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey = (string) content.GetValueForProperty("ExpressRouteAuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey = (string) content.GetValueForProperty("ExpressRouteAuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteAuthorizationKey, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal)this).ExpressRouteId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -163,7 +161,7 @@ internal ExpressRouteAuthorizationProperties(global::System.Management.Automatio /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.TypeConverter.cs index 7337ef8cafdc..37283e894221 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.cs index 770cacb4c040..2e3607d5055a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of an ExpressRoute Circuit Authorization resource public partial class ExpressRouteAuthorizationProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal { /// Backing field for property. @@ -35,20 +35,20 @@ public partial class ExpressRouteAuthorizationProperties : public string ExpressRouteId { get => this._expressRouteId; set => this._expressRouteId = value; } /// Internal Acessors for ExpressRouteAuthorizationId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal.ExpressRouteAuthorizationId { get => this._expressRouteAuthorizationId; set { {_expressRouteAuthorizationId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal.ExpressRouteAuthorizationId { get => this._expressRouteAuthorizationId; set { {_expressRouteAuthorizationId = value;} } } /// Internal Acessors for ExpressRouteAuthorizationKey - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal.ExpressRouteAuthorizationKey { get => this._expressRouteAuthorizationKey; set { {_expressRouteAuthorizationKey = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal.ExpressRouteAuthorizationKey { get => this._expressRouteAuthorizationKey; set { {_expressRouteAuthorizationKey = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? _provisioningState; + private string _provisioningState; /// The state of the ExpressRoute Circuit Authorization provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public ExpressRouteAuthorizationProperties() @@ -64,6 +64,9 @@ public partial interface IExpressRouteAuthorizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The ID of the ExpressRoute Circuit Authorization", SerializedName = @"expressRouteAuthorizationId", PossibleTypes = new [] { typeof(string) })] @@ -72,6 +75,9 @@ public partial interface IExpressRouteAuthorizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The key of the ExpressRoute Circuit Authorization", SerializedName = @"expressRouteAuthorizationKey", PossibleTypes = new [] { typeof(string) })] @@ -80,6 +86,9 @@ public partial interface IExpressRouteAuthorizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the ExpressRoute Circuit", SerializedName = @"expressRouteId", PossibleTypes = new [] { typeof(string) })] @@ -88,10 +97,14 @@ public partial interface IExpressRouteAuthorizationProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the ExpressRoute Circuit Authorization provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; } } /// The properties of an ExpressRoute Circuit Authorization resource @@ -105,7 +118,8 @@ internal partial interface IExpressRouteAuthorizationPropertiesInternal /// The ID of the ExpressRoute Circuit string ExpressRouteId { get; set; } /// The state of the ExpressRoute Circuit Authorization provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.json.cs index bd6914044d19..34d50813d3bb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ExpressRouteAuthorizationProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ExpressRouteAuthorizationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -65,21 +65,21 @@ internal ExpressRouteAuthorizationProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_expressRouteAuthorizationId = If( json?.PropertyT("expressRouteAuthorizationId"), out var __jsonExpressRouteAuthorizationId) ? (string)__jsonExpressRouteAuthorizationId : (string)ExpressRouteAuthorizationId;} - {_expressRouteAuthorizationKey = If( json?.PropertyT("expressRouteAuthorizationKey"), out var __jsonExpressRouteAuthorizationKey) ? (string)__jsonExpressRouteAuthorizationKey : (string)ExpressRouteAuthorizationKey;} - {_expressRouteId = If( json?.PropertyT("expressRouteId"), out var __jsonExpressRouteId) ? (string)__jsonExpressRouteId : (string)ExpressRouteId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_expressRouteAuthorizationId = If( json?.PropertyT("expressRouteAuthorizationId"), out var __jsonExpressRouteAuthorizationId) ? (string)__jsonExpressRouteAuthorizationId : (string)_expressRouteAuthorizationId;} + {_expressRouteAuthorizationKey = If( json?.PropertyT("expressRouteAuthorizationKey"), out var __jsonExpressRouteAuthorizationKey) ? (string)__jsonExpressRouteAuthorizationKey : (string)_expressRouteAuthorizationKey;} + {_expressRouteId = If( json?.PropertyT("expressRouteId"), out var __jsonExpressRouteId) ? (string)__jsonExpressRouteId : (string)_expressRouteId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorizationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ExpressRouteAuthorizationProperties(json) : null; } @@ -104,15 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._expressRouteAuthorizationId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._expressRouteAuthorizationId.ToString()) : null, "expressRouteAuthorizationId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._expressRouteAuthorizationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._expressRouteAuthorizationKey.ToString()) : null, "expressRouteAuthorizationKey" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.PowerShell.cs similarity index 59% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.PowerShell.cs index 0fb85f192fee..d89efa28c104 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class GlobalReachConnection partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IGlobalReachConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GlobalReachConnection(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.VMware.Models.Api20211201.IGlobalReachConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GlobalReachConnection(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlob /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,49 +111,49 @@ internal GlobalReachConnection(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("AddressPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AddressPrefix, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AddressPrefix, global::System.Convert.ToString); } if (content.Contains("AuthorizationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AuthorizationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AuthorizationKey, global::System.Convert.ToString); } if (content.Contains("CircuitConnectionStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).CircuitConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus?) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).CircuitConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).CircuitConnectionStatus = (string) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).CircuitConnectionStatus, global::System.Convert.ToString); } if (content.Contains("PeerExpressRouteCircuit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ExpressRouteId, 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. @@ -168,43 +168,43 @@ internal GlobalReachConnection(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("AddressPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AddressPrefix, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AddressPrefix, global::System.Convert.ToString); } if (content.Contains("AuthorizationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).AuthorizationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).AuthorizationKey, global::System.Convert.ToString); } if (content.Contains("CircuitConnectionStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).CircuitConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus?) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).CircuitConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).CircuitConnectionStatus = (string) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).CircuitConnectionStatus, global::System.Convert.ToString); } if (content.Contains("PeerExpressRouteCircuit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal)this).ExpressRouteId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.TypeConverter.cs index e259dee51489..9b990449b861 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnection ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.cs index 1c06020fbcdb..306268f82e3c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.cs @@ -3,89 +3,88 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A global reach connection resource public partial class GlobalReachConnection : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// /// The network used for global reach carved out from the original network block provided for the private cloud /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string AddressPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).AddressPrefix; } + public string AddressPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).AddressPrefix; } /// /// Authorization key from the peer express route used for the global reach connection /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string AuthorizationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).AuthorizationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).AuthorizationKey = value ?? null; } + public string AuthorizationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).AuthorizationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).AuthorizationKey = value ?? null; } /// The connection status of the global reach connection [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? CircuitConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).CircuitConnectionStatus; } + public string CircuitConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).CircuitConnectionStatus; } /// /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).ExpressRouteId = value ?? null; } + public string ExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).ExpressRouteId = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for AddressPrefix - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal.AddressPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).AddressPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).AddressPrefix = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal.AddressPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).AddressPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).AddressPrefix = value; } /// Internal Acessors for CircuitConnectionStatus - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal.CircuitConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).CircuitConnectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).CircuitConnectionStatus = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal.CircuitConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).CircuitConnectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).CircuitConnectionStatus = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// /// Identifier of the ExpressRoute Circuit to peer with in the global reach connection /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string PeerExpressRouteCircuit { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).PeerExpressRouteCircuit; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).PeerExpressRouteCircuit = value ?? null; } + public string PeerExpressRouteCircuit { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).PeerExpressRouteCircuit; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).PeerExpressRouteCircuit = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties _property; /// The properties of a global reach connection resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionProperties()); set => this._property = value; } /// The state of the ExpressRoute Circuit Authorization provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -93,7 +92,7 @@ public partial class GlobalReachConnection : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public GlobalReachConnection() @@ -116,7 +115,7 @@ public GlobalReachConnection() /// A global reach connection resource public partial interface IGlobalReachConnection : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// /// The network used for global reach carved out from the original network block provided for the private cloud @@ -124,6 +123,9 @@ public partial interface IGlobalReachConnection : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The network used for global reach carved out from the original network block provided for the private cloud", SerializedName = @"addressPrefix", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +136,9 @@ public partial interface IGlobalReachConnection : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Authorization key from the peer express route used for the global reach connection", SerializedName = @"authorizationKey", PossibleTypes = new [] { typeof(string) })] @@ -142,16 +147,23 @@ public partial interface IGlobalReachConnection : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The connection status of the global reach connection", SerializedName = @"circuitConnectionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? CircuitConnectionStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "Connecting", "Disconnected")] + string CircuitConnectionStatus { get; } /// /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", SerializedName = @"expressRouteId", PossibleTypes = new [] { typeof(string) })] @@ -162,6 +174,9 @@ public partial interface IGlobalReachConnection : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", SerializedName = @"peerExpressRouteCircuit", PossibleTypes = new [] { typeof(string) })] @@ -170,15 +185,19 @@ public partial interface IGlobalReachConnection : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the ExpressRoute Circuit Authorization provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; } } /// A global reach connection resource internal partial interface IGlobalReachConnectionInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// /// The network used for global reach carved out from the original network block provided for the private cloud @@ -189,7 +208,8 @@ internal partial interface IGlobalReachConnectionInternal : /// string AuthorizationKey { get; set; } /// The connection status of the global reach connection - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? CircuitConnectionStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "Connecting", "Disconnected")] + string CircuitConnectionStatus { get; set; } /// /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection /// @@ -199,9 +219,10 @@ internal partial interface IGlobalReachConnectionInternal : /// string PeerExpressRouteCircuit { get; set; } /// The properties of a global reach connection resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties Property { get; set; } /// The state of the ExpressRoute Circuit Authorization provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.json.cs index 129ec3c00947..695474a7f7f2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnection.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnection.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class GlobalReachConnection partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new GlobalReachConnection(json) : null; } @@ -77,8 +77,8 @@ internal GlobalReachConnection(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.PowerShell.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.PowerShell.cs index 16faa7f60aa8..0b0c18b1fcb9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class GlobalReachConnectionList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IGlobalReachConnectionList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GlobalReachConnectionList(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.VMware.Models.Api20211201.IGlobalReachConnectionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GlobalReachConnectionList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlob /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal GlobalReachConnectionList(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).NextLink, 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,11 +136,11 @@ internal GlobalReachConnectionList(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.TypeConverter.cs index 31a85dc5f482..df6cd51e4ae8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnectionList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.cs index f7fad5f0aa86..7f9248cf2fba 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of global reach connections public partial class GlobalReachConnectionList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class GlobalReachConnectionList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public GlobalReachConnectionList() @@ -47,6 +47,9 @@ public partial interface IGlobalReachConnectionList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IGlobalReachConnectionList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection) })] + System.Collections.Generic.List Value { get; } } /// A paged list of global reach connections @@ -68,7 +74,7 @@ internal partial interface IGlobalReachConnectionListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.json.cs index be2560c4e79d..2751246a89ca 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class GlobalReachConnectionList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new GlobalReachConnectionList(json) : null; } @@ -77,8 +77,8 @@ internal GlobalReachConnectionList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnection) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnection.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.VMware.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.VMware.Models.IGlobalReachConnection) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.PowerShell.cs similarity index 64% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.PowerShell.cs index 47c8c7d8b3ec..0759b6826462 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class GlobalReachConnectionProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IGlobalReachConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GlobalReachConnectionProperties(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.VMware.Models.Api20211201.IGlobalReachConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GlobalReachConnectionProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlob /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -113,33 +111,33 @@ internal GlobalReachConnectionProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("AddressPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix, global::System.Convert.ToString); } if (content.Contains("AuthorizationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey, global::System.Convert.ToString); } if (content.Contains("CircuitConnectionStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus?) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus = (string) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus, global::System.Convert.ToString); } if (content.Contains("PeerExpressRouteCircuit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId, 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. @@ -154,27 +152,27 @@ internal GlobalReachConnectionProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("AddressPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix = (string) content.GetValueForProperty("AddressPrefix",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AddressPrefix, global::System.Convert.ToString); } if (content.Contains("AuthorizationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey = (string) content.GetValueForProperty("AuthorizationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).AuthorizationKey, global::System.Convert.ToString); } if (content.Contains("CircuitConnectionStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus?) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus = (string) content.GetValueForProperty("CircuitConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).CircuitConnectionStatus, global::System.Convert.ToString); } if (content.Contains("PeerExpressRouteCircuit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit = (string) content.GetValueForProperty("PeerExpressRouteCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).PeerExpressRouteCircuit, global::System.Convert.ToString); } if (content.Contains("ExpressRouteId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId = (string) content.GetValueForProperty("ExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal)this).ExpressRouteId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.TypeConverter.cs index 4ae0dd880f28..b56e77d6ee5e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.cs index 37d44ae6dbdf..4a7499d4c705 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a global reach connection public partial class GlobalReachConnectionProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal { /// Backing field for property. @@ -32,11 +32,11 @@ public partial class GlobalReachConnectionProperties : public string AuthorizationKey { get => this._authorizationKey; set => this._authorizationKey = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? _circuitConnectionStatus; + private string _circuitConnectionStatus; /// The connection status of the global reach connection [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? CircuitConnectionStatus { get => this._circuitConnectionStatus; } + public string CircuitConnectionStatus { get => this._circuitConnectionStatus; } /// Backing field for property. private string _expressRouteId; @@ -48,13 +48,13 @@ public partial class GlobalReachConnectionProperties : public string ExpressRouteId { get => this._expressRouteId; set => this._expressRouteId = value; } /// Internal Acessors for AddressPrefix - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal.AddressPrefix { get => this._addressPrefix; set { {_addressPrefix = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal.AddressPrefix { get => this._addressPrefix; set { {_addressPrefix = value;} } } /// Internal Acessors for CircuitConnectionStatus - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal.CircuitConnectionStatus { get => this._circuitConnectionStatus; set { {_circuitConnectionStatus = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal.CircuitConnectionStatus { get => this._circuitConnectionStatus; set { {_circuitConnectionStatus = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. private string _peerExpressRouteCircuit; @@ -66,11 +66,11 @@ public partial class GlobalReachConnectionProperties : public string PeerExpressRouteCircuit { get => this._peerExpressRouteCircuit; set => this._peerExpressRouteCircuit = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? _provisioningState; + private string _provisioningState; /// The state of the ExpressRoute Circuit Authorization provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Creates an new instance. public GlobalReachConnectionProperties() @@ -88,6 +88,9 @@ public partial interface IGlobalReachConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The network used for global reach carved out from the original network block provided for the private cloud", SerializedName = @"addressPrefix", PossibleTypes = new [] { typeof(string) })] @@ -98,6 +101,9 @@ public partial interface IGlobalReachConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Authorization key from the peer express route used for the global reach connection", SerializedName = @"authorizationKey", PossibleTypes = new [] { typeof(string) })] @@ -106,16 +112,23 @@ public partial interface IGlobalReachConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The connection status of the global reach connection", SerializedName = @"circuitConnectionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? CircuitConnectionStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "Connecting", "Disconnected")] + string CircuitConnectionStatus { get; } /// /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", SerializedName = @"expressRouteId", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +139,9 @@ public partial interface IGlobalReachConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", SerializedName = @"peerExpressRouteCircuit", PossibleTypes = new [] { typeof(string) })] @@ -134,10 +150,14 @@ public partial interface IGlobalReachConnectionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the ExpressRoute Circuit Authorization provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; } } /// The properties of a global reach connection @@ -153,7 +173,8 @@ internal partial interface IGlobalReachConnectionPropertiesInternal /// string AuthorizationKey { get; set; } /// The connection status of the global reach connection - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus? CircuitConnectionStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "Connecting", "Disconnected")] + string CircuitConnectionStatus { get; set; } /// /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection /// @@ -163,7 +184,8 @@ internal partial interface IGlobalReachConnectionPropertiesInternal /// string PeerExpressRouteCircuit { get; set; } /// The state of the ExpressRoute Circuit Authorization provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Updating", "Canceled")] + string ProvisioningState { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.json.cs index d1091c112f38..f83f330ed5ee 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/GlobalReachConnectionProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/GlobalReachConnectionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class GlobalReachConnectionProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new GlobalReachConnectionProperties(json) : null; } @@ -77,12 +77,12 @@ internal GlobalReachConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets.VMwa { return; } - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_addressPrefix = If( json?.PropertyT("addressPrefix"), out var __jsonAddressPrefix) ? (string)__jsonAddressPrefix : (string)AddressPrefix;} - {_authorizationKey = If( json?.PropertyT("authorizationKey"), out var __jsonAuthorizationKey) ? (string)__jsonAuthorizationKey : (string)AuthorizationKey;} - {_circuitConnectionStatus = If( json?.PropertyT("circuitConnectionStatus"), out var __jsonCircuitConnectionStatus) ? (string)__jsonCircuitConnectionStatus : (string)CircuitConnectionStatus;} - {_peerExpressRouteCircuit = If( json?.PropertyT("peerExpressRouteCircuit"), out var __jsonPeerExpressRouteCircuit) ? (string)__jsonPeerExpressRouteCircuit : (string)PeerExpressRouteCircuit;} - {_expressRouteId = If( json?.PropertyT("expressRouteId"), out var __jsonExpressRouteId) ? (string)__jsonExpressRouteId : (string)ExpressRouteId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_addressPrefix = If( json?.PropertyT("addressPrefix"), out var __jsonAddressPrefix) ? (string)__jsonAddressPrefix : (string)_addressPrefix;} + {_authorizationKey = If( json?.PropertyT("authorizationKey"), out var __jsonAuthorizationKey) ? (string)__jsonAuthorizationKey : (string)_authorizationKey;} + {_circuitConnectionStatus = If( json?.PropertyT("circuitConnectionStatus"), out var __jsonCircuitConnectionStatus) ? (string)__jsonCircuitConnectionStatus : (string)_circuitConnectionStatus;} + {_peerExpressRouteCircuit = If( json?.PropertyT("peerExpressRouteCircuit"), out var __jsonPeerExpressRouteCircuit) ? (string)__jsonPeerExpressRouteCircuit : (string)_peerExpressRouteCircuit;} + {_expressRouteId = If( json?.PropertyT("expressRouteId"), out var __jsonExpressRouteId) ? (string)__jsonExpressRouteId : (string)_expressRouteId;} AfterFromJson(json); } @@ -105,16 +105,16 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._addressPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._addressPrefix.ToString()) : null, "addressPrefix" ,container.Add ); } AddIf( null != (((object)this._authorizationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._authorizationKey.ToString()) : null, "authorizationKey" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._circuitConnectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._circuitConnectionStatus.ToString()) : null, "circuitConnectionStatus" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.PowerShell.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.PowerShell.cs index 86fe72ce1a42..454e28ccab98 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class HcxEnterpriseSite partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IHcxEnterpriseSite DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HcxEnterpriseSite(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.VMware.Models.Api20211201.IHcxEnterpriseSite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HcxEnterpriseSite(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxE /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,33 +111,33 @@ internal HcxEnterpriseSite(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSitePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSitePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ActivationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).ActivationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).ActivationKey, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Status, 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. @@ -152,27 +152,27 @@ internal HcxEnterpriseSite(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSitePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSitePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("ActivationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).ActivationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).ActivationKey, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.TypeConverter.cs index 33babbfcf433..0c430d5ae4f6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IHcxEnterpriseSite ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.cs similarity index 60% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.cs index 44c1eda8d2bf..b7a72ff5f568 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.cs @@ -3,58 +3,57 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An HCX Enterprise Site resource public partial class HcxEnterpriseSite : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// The activation key [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ActivationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)Property).ActivationKey; } + public string ActivationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)Property).ActivationKey; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for ActivationKey - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal.ActivationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)Property).ActivationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)Property).ActivationKey = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal.ActivationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)Property).ActivationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)Property).ActivationKey = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteProperties()); set { {_property = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)Property).Status = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties _property; /// The properties of an HCX Enterprise Site resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteProperties()); } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteProperties()); } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -62,11 +61,11 @@ public partial class HcxEnterpriseSite : /// The status of the HCX Enterprise Site [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)Property).Status; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public HcxEnterpriseSite() @@ -89,12 +88,15 @@ public HcxEnterpriseSite() /// An HCX Enterprise Site resource public partial interface IHcxEnterpriseSite : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// The activation key [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The activation key", SerializedName = @"activationKey", PossibleTypes = new [] { typeof(string) })] @@ -103,22 +105,27 @@ public partial interface IHcxEnterpriseSite : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the HCX Enterprise Site", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Available", "Consumed", "Deactivated", "Deleted")] + string Status { get; } } /// An HCX Enterprise Site resource internal partial interface IHcxEnterpriseSiteInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// The activation key string ActivationKey { get; set; } /// The properties of an HCX Enterprise Site resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties Property { get; set; } /// The status of the HCX Enterprise Site - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Available", "Consumed", "Deactivated", "Deleted")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.json.cs index 948ce7221778..564db0dd3b89 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSite.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSite.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class HcxEnterpriseSite partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new HcxEnterpriseSite(json) : null; } @@ -77,8 +77,8 @@ internal HcxEnterpriseSite(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Jso { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -102,7 +102,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } __resource?.ToJson(container, serializationMode); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.PowerShell.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.PowerShell.cs index 839dceefd79d..2dac3a4c6512 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class HcxEnterpriseSiteList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IHcxEnterpriseSiteList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HcxEnterpriseSiteList(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.VMware.Models.Api20211201.IHcxEnterpriseSiteList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HcxEnterpriseSiteList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxE /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal HcxEnterpriseSiteList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).NextLink, 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,11 +136,11 @@ internal HcxEnterpriseSiteList(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.TypeConverter.cs index 2e3fbf68077e..326dd7fde437 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IHcxEnterpriseSiteList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.cs index 13b50150629d..5666232e2478 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of HCX Enterprise Sites public partial class HcxEnterpriseSiteList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class HcxEnterpriseSiteList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[] _value; + private System.Collections.Generic.List _value; /// The items on a page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public HcxEnterpriseSiteList() @@ -47,6 +47,9 @@ public partial interface IHcxEnterpriseSiteList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IHcxEnterpriseSiteList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on a page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite) })] + System.Collections.Generic.List Value { get; } } /// A paged list of HCX Enterprise Sites @@ -68,7 +74,7 @@ internal partial interface IHcxEnterpriseSiteListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on a page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.json.cs index 11f5313aa2f3..cc257c9865ca 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class HcxEnterpriseSiteList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new HcxEnterpriseSiteList(json) : null; } @@ -77,8 +77,8 @@ internal HcxEnterpriseSiteList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IHcxEnterpriseSite) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSite.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.VMware.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.VMware.Models.IHcxEnterpriseSite) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.PowerShell.cs index 6cd5adbf781f..6d44efa7bffd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class HcxEnterpriseSiteProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HcxEnterpriseSiteProperties(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.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HcxEnterpriseSiteProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxE /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal HcxEnterpriseSiteProperties(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("ActivationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).Status, 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,11 +136,11 @@ internal HcxEnterpriseSiteProperties(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("ActivationKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey = (string) content.GetValueForProperty("ActivationKey",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).ActivationKey, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal)this).Status, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.TypeConverter.cs index 7bc721dc64d6..b3a9527d208a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.cs index 8fc67c30175d..b5e5eda73649 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of an HCX Enterprise Site public partial class HcxEnterpriseSiteProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal { /// Backing field for property. @@ -21,17 +21,17 @@ public partial class HcxEnterpriseSiteProperties : public string ActivationKey { get => this._activationKey; } /// Internal Acessors for ActivationKey - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal.ActivationKey { get => this._activationKey; set { {_activationKey = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal.ActivationKey { get => this._activationKey; set { {_activationKey = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSitePropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSitePropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? _status; + private string _status; /// The status of the HCX Enterprise Site [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public HcxEnterpriseSiteProperties() @@ -47,6 +47,9 @@ public partial interface IHcxEnterpriseSiteProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The activation key", SerializedName = @"activationKey", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,14 @@ public partial interface IHcxEnterpriseSiteProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status of the HCX Enterprise Site", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Available", "Consumed", "Deactivated", "Deleted")] + string Status { get; } } /// The properties of an HCX Enterprise Site @@ -68,7 +75,8 @@ internal partial interface IHcxEnterpriseSitePropertiesInternal /// The activation key string ActivationKey { get; set; } /// The status of the HCX Enterprise Site - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Available", "Consumed", "Deactivated", "Deleted")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.json.cs index 675d0217af40..333a9c370e93 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/HcxEnterpriseSiteProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/HcxEnterpriseSiteProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class HcxEnterpriseSiteProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSiteProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSiteProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new HcxEnterpriseSiteProperties(json) : null; } @@ -77,8 +77,8 @@ internal HcxEnterpriseSiteProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.R { return; } - {_activationKey = If( json?.PropertyT("activationKey"), out var __jsonActivationKey) ? (string)__jsonActivationKey : (string)ActivationKey;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_activationKey = If( json?.PropertyT("activationKey"), out var __jsonActivationKey) ? (string)__jsonActivationKey : (string)_activationKey;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._activationKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._activationKey.ToString()) : null, "activationKey" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.PowerShell.cs similarity index 64% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.PowerShell.cs index f03589c973f2..56f8c2ba7bfa 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class IdentitySource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IIdentitySource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IdentitySource(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.VMware.Models.Api20211201.IIdentitySource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IdentitySource(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIden /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,49 +111,49 @@ internal IdentitySource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Alias")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Alias, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Alias, global::System.Convert.ToString); } if (content.Contains("Domain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Domain = (string) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Domain, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Domain = (string) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Domain, global::System.Convert.ToString); } if (content.Contains("BaseUserDn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseUserDn = (string) content.GetValueForProperty("BaseUserDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseUserDn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseUserDn = (string) content.GetValueForProperty("BaseUserDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseUserDn, global::System.Convert.ToString); } if (content.Contains("BaseGroupDn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseGroupDn = (string) content.GetValueForProperty("BaseGroupDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseGroupDn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseGroupDn = (string) content.GetValueForProperty("BaseGroupDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseGroupDn, global::System.Convert.ToString); } if (content.Contains("PrimaryServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).PrimaryServer = (string) content.GetValueForProperty("PrimaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).PrimaryServer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).PrimaryServer = (string) content.GetValueForProperty("PrimaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).PrimaryServer, global::System.Convert.ToString); } if (content.Contains("SecondaryServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).SecondaryServer = (string) content.GetValueForProperty("SecondaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).SecondaryServer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).SecondaryServer = (string) content.GetValueForProperty("SecondaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).SecondaryServer, global::System.Convert.ToString); } if (content.Contains("Ssl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Ssl = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum?) content.GetValueForProperty("Ssl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Ssl, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Ssl = (string) content.GetValueForProperty("Ssl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Ssl, global::System.Convert.ToString); } if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Username, global::System.Convert.ToString); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Password, 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. @@ -168,43 +168,43 @@ internal IdentitySource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Alias")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Alias, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Alias = (string) content.GetValueForProperty("Alias",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Alias, global::System.Convert.ToString); } if (content.Contains("Domain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Domain = (string) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Domain, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Domain = (string) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Domain, global::System.Convert.ToString); } if (content.Contains("BaseUserDn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseUserDn = (string) content.GetValueForProperty("BaseUserDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseUserDn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseUserDn = (string) content.GetValueForProperty("BaseUserDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseUserDn, global::System.Convert.ToString); } if (content.Contains("BaseGroupDn")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseGroupDn = (string) content.GetValueForProperty("BaseGroupDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).BaseGroupDn, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseGroupDn = (string) content.GetValueForProperty("BaseGroupDn",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).BaseGroupDn, global::System.Convert.ToString); } if (content.Contains("PrimaryServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).PrimaryServer = (string) content.GetValueForProperty("PrimaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).PrimaryServer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).PrimaryServer = (string) content.GetValueForProperty("PrimaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).PrimaryServer, global::System.Convert.ToString); } if (content.Contains("SecondaryServer")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).SecondaryServer = (string) content.GetValueForProperty("SecondaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).SecondaryServer, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).SecondaryServer = (string) content.GetValueForProperty("SecondaryServer",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).SecondaryServer, global::System.Convert.ToString); } if (content.Contains("Ssl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Ssl = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum?) content.GetValueForProperty("Ssl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Ssl, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Ssl = (string) content.GetValueForProperty("Ssl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Ssl, global::System.Convert.ToString); } if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Username, global::System.Convert.ToString); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal)this).Password, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.TypeConverter.cs index 3f8a7128d5cf..2c91534c14ea 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IIdentitySource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.cs b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.cs rename to src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.cs index 52e8b2d42d5d..10988136b8f7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// vCenter Single Sign On Identity Source public partial class IdentitySource : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySourceInternal { /// Backing field for property. @@ -72,11 +72,11 @@ public partial class IdentitySource : public string SecondaryServer { get => this._secondaryServer; set => this._secondaryServer = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum? _ssl; + private string _ssl; /// Protect LDAP communication using SSL certificate (LDAPS) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum? Ssl { get => this._ssl; set => this._ssl = value; } + public string Ssl { get => this._ssl; set => this._ssl = value; } /// Backing field for property. private string _username; @@ -101,6 +101,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The domain's NetBIOS name", SerializedName = @"alias", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +112,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The base distinguished name for groups", SerializedName = @"baseGroupDN", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +123,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The base distinguished name for users", SerializedName = @"baseUserDN", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +134,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The domain's dns name", SerializedName = @"domain", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +145,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the identity source", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -143,6 +158,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups.", SerializedName = @"password", PossibleTypes = new [] { typeof(string) })] @@ -151,6 +169,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Primary server URL", SerializedName = @"primaryServer", PossibleTypes = new [] { typeof(string) })] @@ -159,6 +180,9 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Secondary server URL", SerializedName = @"secondaryServer", PossibleTypes = new [] { typeof(string) })] @@ -167,16 +191,23 @@ public partial interface IIdentitySource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Protect LDAP communication using SSL certificate (LDAPS)", SerializedName = @"ssl", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum? Ssl { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Ssl { get; set; } /// /// The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] @@ -206,7 +237,8 @@ internal partial interface IIdentitySourceInternal /// Secondary server URL string SecondaryServer { get; set; } /// Protect LDAP communication using SSL certificate (LDAPS) - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum? Ssl { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Ssl { get; set; } /// /// The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group /// diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.json.cs index 583c85187d42..d51faa382035 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/IdentitySource.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/IdentitySource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IdentitySource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new IdentitySource(json) : null; } @@ -77,16 +77,16 @@ internal IdentitySource(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.J { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_alias = If( json?.PropertyT("alias"), out var __jsonAlias) ? (string)__jsonAlias : (string)Alias;} - {_domain = If( json?.PropertyT("domain"), out var __jsonDomain) ? (string)__jsonDomain : (string)Domain;} - {_baseUserDn = If( json?.PropertyT("baseUserDN"), out var __jsonBaseUserDn) ? (string)__jsonBaseUserDn : (string)BaseUserDn;} - {_baseGroupDn = If( json?.PropertyT("baseGroupDN"), out var __jsonBaseGroupDn) ? (string)__jsonBaseGroupDn : (string)BaseGroupDn;} - {_primaryServer = If( json?.PropertyT("primaryServer"), out var __jsonPrimaryServer) ? (string)__jsonPrimaryServer : (string)PrimaryServer;} - {_secondaryServer = If( json?.PropertyT("secondaryServer"), out var __jsonSecondaryServer) ? (string)__jsonSecondaryServer : (string)SecondaryServer;} - {_ssl = If( json?.PropertyT("ssl"), out var __jsonSsl) ? (string)__jsonSsl : (string)Ssl;} - {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_alias = If( json?.PropertyT("alias"), out var __jsonAlias) ? (string)__jsonAlias : (string)_alias;} + {_domain = If( json?.PropertyT("domain"), out var __jsonDomain) ? (string)__jsonDomain : (string)_domain;} + {_baseUserDn = If( json?.PropertyT("baseUserDN"), out var __jsonBaseUserDn) ? (string)__jsonBaseUserDn : (string)_baseUserDn;} + {_baseGroupDn = If( json?.PropertyT("baseGroupDN"), out var __jsonBaseGroupDn) ? (string)__jsonBaseGroupDn : (string)_baseGroupDn;} + {_primaryServer = If( json?.PropertyT("primaryServer"), out var __jsonPrimaryServer) ? (string)__jsonPrimaryServer : (string)_primaryServer;} + {_secondaryServer = If( json?.PropertyT("secondaryServer"), out var __jsonSecondaryServer) ? (string)__jsonSecondaryServer : (string)_secondaryServer;} + {_ssl = If( json?.PropertyT("ssl"), out var __jsonSsl) ? (string)__jsonSsl : (string)_ssl;} + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)_username;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)_password;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.PowerShell.cs index d800ed349b36..bc6e1abdaff2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class LogSpecification partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.ILogSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LogSpecification(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.VMware.Models.Api20211201.ILogSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LogSpecification(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogS /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,21 +111,21 @@ internal LogSpecification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("BlobDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).BlobDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).BlobDuration, 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. @@ -140,15 +140,15 @@ internal LogSpecification(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("BlobDuration")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal)this).BlobDuration, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).BlobDuration = (string) content.GetValueForProperty("BlobDuration",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal)this).BlobDuration, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.TypeConverter.cs index 9fb9bfdd20a0..08d9bde9ffed 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ILogSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.cs b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.cs rename to src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.cs index 95192bbfcaaa..30de87bba335 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Specifications of the Log for Azure Monitoring public partial class LogSpecification : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecificationInternal { /// Backing field for property. @@ -48,6 +48,9 @@ public partial interface ILogSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Blob duration of the log", SerializedName = @"blobDuration", PossibleTypes = new [] { typeof(string) })] @@ -56,6 +59,9 @@ public partial interface ILogSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Localized friendly display name of the log", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +70,9 @@ public partial interface ILogSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the log", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.json.cs index 541043623cb3..8c0640cc4165 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/LogSpecification.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/LogSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LogSpecification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new LogSpecification(json) : null; } @@ -77,9 +77,9 @@ internal LogSpecification(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_blobDuration = If( json?.PropertyT("blobDuration"), out var __jsonBlobDuration) ? (string)__jsonBlobDuration : (string)BlobDuration;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_blobDuration = If( json?.PropertyT("blobDuration"), out var __jsonBlobDuration) ? (string)__jsonBlobDuration : (string)_blobDuration;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.PowerShell.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.PowerShell.cs index 9abd049c83c3..5c53ef3821ec 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ManagementCluster partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IManagementCluster DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagementCluster(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.VMware.Models.Api20211201.IManagementCluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagementCluster(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMana /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementCluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,25 +111,25 @@ internal ManagementCluster(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host, __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. @@ -144,19 +144,19 @@ internal ManagementCluster(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("ClusterSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize = (int?) content.GetValueForProperty("ClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("ClusterId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId = (int?) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).ClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } if (content.Contains("Host")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host = (string[]) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host = (System.Collections.Generic.List) content.GetValueForProperty("Host",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)this).Host, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.TypeConverter.cs index 3c72b9518f16..8b1ead0b5a78 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IManagementCluster ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementCluster).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.cs b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.cs similarity index 53% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.cs index fd0aa9743aa5..a7e8f9d43803 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.cs @@ -3,43 +3,43 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a management cluster public partial class ManagementCluster : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementCluster, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementClusterInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementClusterInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CommonClusterProperties(); /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; } + public int? ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; } /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? ClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize = value ?? default(int); } + public int? ClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterSize = value ?? default(int); } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string[] Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).Host = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Host { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).Host = value ?? null /* arrayOf */; } /// Internal Acessors for ClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ClusterId = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState = value; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)__commonClusterProperties).ProvisioningState; } /// Creates an new instance. public ManagementCluster() @@ -62,13 +62,13 @@ public ManagementCluster() /// The properties of a management cluster public partial interface IManagementCluster : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterProperties { } /// The properties of a management cluster internal partial interface IManagementClusterInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal { } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.json.cs index fef483f8778f..00b76617a6f5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ManagementCluster.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ManagementCluster.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ManagementCluster partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementCluster. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementCluster. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IManagementCluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ManagementCluster(json) : null; } @@ -77,7 +77,7 @@ internal ManagementCluster(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Jso { return; } - __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties(json); + __commonClusterProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CommonClusterProperties(json); AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.PowerShell.cs index 00e0a69b4f15..1d51654fd9ac 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class MetricDimension partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IMetricDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MetricDimension(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.VMware.Models.Api20211201.IMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricDimension(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,25 +111,25 @@ internal MetricDimension(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("InternalName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).InternalName = (string) content.GetValueForProperty("InternalName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).InternalName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).InternalName = (string) content.GetValueForProperty("InternalName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).InternalName, global::System.Convert.ToString); } if (content.Contains("ToBeExportedForShoebox")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } 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,19 +144,19 @@ internal MetricDimension(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("InternalName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).InternalName = (string) content.GetValueForProperty("InternalName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).InternalName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).InternalName = (string) content.GetValueForProperty("InternalName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).InternalName, global::System.Convert.ToString); } if (content.Contains("ToBeExportedForShoebox")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox = (bool?) content.GetValueForProperty("ToBeExportedForShoebox",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal)this).ToBeExportedForShoebox, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.TypeConverter.cs index 9a228d634bf1..26c85aa7b540 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IMetricDimension ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.cs index 606b3713ee83..524d171dcae6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Specifications of the Dimension of metrics public partial class MetricDimension : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimensionInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimensionInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Localized friendly display name of the dimension", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the dimension as it appears in MDM", SerializedName = @"internalName", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the dimension", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +92,9 @@ public partial interface IMetricDimension : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A boolean flag indicating whether this dimension should be included for the shoebox export scenario", SerializedName = @"toBeExportedForShoebox", PossibleTypes = new [] { typeof(bool) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.json.cs index bb6a59fe04cd..2500f9ae1832 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricDimension.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricDimension.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MetricDimension partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new MetricDimension(json) : null; } @@ -77,10 +77,10 @@ internal MetricDimension(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json. { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_internalName = If( json?.PropertyT("internalName"), out var __jsonInternalName) ? (string)__jsonInternalName : (string)InternalName;} - {_toBeExportedForShoebox = If( json?.PropertyT("toBeExportedForShoebox"), out var __jsonToBeExportedForShoebox) ? (bool?)__jsonToBeExportedForShoebox : ToBeExportedForShoebox;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_internalName = If( json?.PropertyT("internalName"), out var __jsonInternalName) ? (string)__jsonInternalName : (string)_internalName;} + {_toBeExportedForShoebox = If( json?.PropertyT("toBeExportedForShoebox"), out var __jsonToBeExportedForShoebox) ? (bool?)__jsonToBeExportedForShoebox : _toBeExportedForShoebox;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.PowerShell.cs similarity index 57% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.PowerShell.cs index d68979141c65..92112ce9b65e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class MetricSpecification partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IMetricSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new MetricSpecification(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.VMware.Models.Api20211201.IMetricSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new MetricSpecification(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,61 +111,61 @@ internal MetricSpecification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("Unit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("AggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); } if (content.Contains("SupportedAggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedAggregationType = (string[]) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedAggregationType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SupportedTimeGrainType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedTimeGrainType = (string[]) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("FillGapWithZero")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricDimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricDimensionTypeConverter.ConvertFrom)); } if (content.Contains("EnableRegionalMdmAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).EnableRegionalMdmAccount = (string) content.GetValueForProperty("EnableRegionalMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).EnableRegionalMdmAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).EnableRegionalMdmAccount = (string) content.GetValueForProperty("EnableRegionalMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).EnableRegionalMdmAccount, global::System.Convert.ToString); } if (content.Contains("SourceMdmAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmAccount = (string) content.GetValueForProperty("SourceMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmAccount = (string) content.GetValueForProperty("SourceMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmAccount, global::System.Convert.ToString); } if (content.Contains("SourceMdmNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmNamespace, 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. @@ -180,55 +180,55 @@ internal MetricSpecification(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("Unit")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); } if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("AggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); } if (content.Contains("SupportedAggregationType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedAggregationType = (string[]) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedAggregationType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedAggregationType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedAggregationType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SupportedTimeGrainType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedTimeGrainType = (string[]) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType = (System.Collections.Generic.List) content.GetValueForProperty("SupportedTimeGrainType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SupportedTimeGrainType, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("FillGapWithZero")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Dimension")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricDimensionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Dimension = (System.Collections.Generic.List) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricDimensionTypeConverter.ConvertFrom)); } if (content.Contains("EnableRegionalMdmAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).EnableRegionalMdmAccount = (string) content.GetValueForProperty("EnableRegionalMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).EnableRegionalMdmAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).EnableRegionalMdmAccount = (string) content.GetValueForProperty("EnableRegionalMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).EnableRegionalMdmAccount, global::System.Convert.ToString); } if (content.Contains("SourceMdmAccount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmAccount = (string) content.GetValueForProperty("SourceMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmAccount, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmAccount = (string) content.GetValueForProperty("SourceMdmAccount",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmAccount, global::System.Convert.ToString); } if (content.Contains("SourceMdmNamespace")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal)this).SourceMdmNamespace, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmNamespace = (string) content.GetValueForProperty("SourceMdmNamespace",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal)this).SourceMdmNamespace, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.TypeConverter.cs index a08de46004c4..57eeb8811307 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IMetricSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.cs similarity index 83% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.cs index ab16c9e7f680..5dbdd658242d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Specifications of the Metrics for Azure Monitoring public partial class MetricSpecification : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecificationInternal { /// Backing field for property. @@ -32,11 +32,11 @@ public partial class MetricSpecification : public string Category { get => this._category; set => this._category = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension[] _dimension; + private System.Collections.Generic.List _dimension; /// Dimensions of the metric [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension[] Dimension { get => this._dimension; set => this._dimension = value; } + public System.Collections.Generic.List Dimension { get => this._dimension; set => this._dimension = value; } /// Backing field for property. private string _displayDescription; @@ -90,18 +90,18 @@ public partial class MetricSpecification : public string SourceMdmNamespace { get => this._sourceMdmNamespace; set => this._sourceMdmNamespace = value; } /// Backing field for property. - private string[] _supportedAggregationType; + private System.Collections.Generic.List _supportedAggregationType; /// Supported aggregation types [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] SupportedAggregationType { get => this._supportedAggregationType; set => this._supportedAggregationType = value; } + public System.Collections.Generic.List SupportedAggregationType { get => this._supportedAggregationType; set => this._supportedAggregationType = value; } /// Backing field for property. - private string[] _supportedTimeGrainType; + private System.Collections.Generic.List _supportedTimeGrainType; /// Supported time grain types [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] SupportedTimeGrainType { get => this._supportedTimeGrainType; set => this._supportedTimeGrainType = value; } + public System.Collections.Generic.List SupportedTimeGrainType { get => this._supportedTimeGrainType; set => this._supportedTimeGrainType = value; } /// Backing field for property. private string _unit; @@ -126,6 +126,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count.", SerializedName = @"aggregationType", PossibleTypes = new [] { typeof(string) })] @@ -136,6 +139,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the metric category that the metric belongs to. A metric can only belong to a single category.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -144,14 +150,20 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Dimensions of the metric", SerializedName = @"dimensions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension[] Dimension { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension) })] + System.Collections.Generic.List Dimension { get; set; } /// Localized friendly description of the metric [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Localized friendly description of the metric", SerializedName = @"displayDescription", PossibleTypes = new [] { typeof(string) })] @@ -160,6 +172,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Localized friendly display name of the metric", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -168,6 +183,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether or not the service is using regional MDM accounts.", SerializedName = @"enableRegionalMdmAccount", PossibleTypes = new [] { typeof(string) })] @@ -178,6 +196,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published.", SerializedName = @"fillGapWithZero", PossibleTypes = new [] { typeof(bool) })] @@ -186,6 +207,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the metric", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +218,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the MDM account.", SerializedName = @"sourceMdmAccount", PossibleTypes = new [] { typeof(string) })] @@ -202,6 +229,9 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the MDM namespace.", SerializedName = @"sourceMdmNamespace", PossibleTypes = new [] { typeof(string) })] @@ -210,22 +240,31 @@ public partial interface IMetricSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Supported aggregation types", SerializedName = @"supportedAggregationTypes", PossibleTypes = new [] { typeof(string) })] - string[] SupportedAggregationType { get; set; } + System.Collections.Generic.List SupportedAggregationType { get; set; } /// Supported time grain types [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Supported time grain types", SerializedName = @"supportedTimeGrainTypes", PossibleTypes = new [] { typeof(string) })] - string[] SupportedTimeGrainType { get; set; } + System.Collections.Generic.List SupportedTimeGrainType { get; set; } /// Unit that makes sense for the metric [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Unit that makes sense for the metric", SerializedName = @"unit", PossibleTypes = new [] { typeof(string) })] @@ -245,7 +284,7 @@ internal partial interface IMetricSpecificationInternal /// string Category { get; set; } /// Dimensions of the metric - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension[] Dimension { get; set; } + System.Collections.Generic.List Dimension { get; set; } /// Localized friendly description of the metric string DisplayDescription { get; set; } /// Localized friendly display name of the metric @@ -263,9 +302,9 @@ internal partial interface IMetricSpecificationInternal /// The name of the MDM namespace. string SourceMdmNamespace { get; set; } /// Supported aggregation types - string[] SupportedAggregationType { get; set; } + System.Collections.Generic.List SupportedAggregationType { get; set; } /// Supported time grain types - string[] SupportedTimeGrainType { get; set; } + System.Collections.Generic.List SupportedTimeGrainType { get; set; } /// Unit that makes sense for the metric string Unit { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.json.cs similarity index 87% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.json.cs index 99e38067d5af..9911d7975a9a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/MetricSpecification.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/MetricSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MetricSpecification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new MetricSpecification(json) : null; } @@ -77,19 +77,19 @@ internal MetricSpecification(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_displayDescription = If( json?.PropertyT("displayDescription"), out var __jsonDisplayDescription) ? (string)__jsonDisplayDescription : (string)DisplayDescription;} - {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_aggregationType = If( json?.PropertyT("aggregationType"), out var __jsonAggregationType) ? (string)__jsonAggregationType : (string)AggregationType;} - {_supportedAggregationType = If( json?.PropertyT("supportedAggregationTypes"), out var __jsonSupportedAggregationTypes) ? If( __jsonSupportedAggregationTypes as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportedAggregationType;} - {_supportedTimeGrainType = If( json?.PropertyT("supportedTimeGrainTypes"), out var __jsonSupportedTimeGrainTypes) ? If( __jsonSupportedTimeGrainTypes as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : SupportedTimeGrainType;} - {_fillGapWithZero = If( json?.PropertyT("fillGapWithZero"), out var __jsonFillGapWithZero) ? (bool?)__jsonFillGapWithZero : FillGapWithZero;} - {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricDimension.FromJson(__k) )) ))() : null : Dimension;} - {_enableRegionalMdmAccount = If( json?.PropertyT("enableRegionalMdmAccount"), out var __jsonEnableRegionalMdmAccount) ? (string)__jsonEnableRegionalMdmAccount : (string)EnableRegionalMdmAccount;} - {_sourceMdmAccount = If( json?.PropertyT("sourceMdmAccount"), out var __jsonSourceMdmAccount) ? (string)__jsonSourceMdmAccount : (string)SourceMdmAccount;} - {_sourceMdmNamespace = If( json?.PropertyT("sourceMdmNamespace"), out var __jsonSourceMdmNamespace) ? (string)__jsonSourceMdmNamespace : (string)SourceMdmNamespace;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_displayDescription = If( json?.PropertyT("displayDescription"), out var __jsonDisplayDescription) ? (string)__jsonDisplayDescription : (string)_displayDescription;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)_unit;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_aggregationType = If( json?.PropertyT("aggregationType"), out var __jsonAggregationType) ? (string)__jsonAggregationType : (string)_aggregationType;} + {_supportedAggregationType = If( json?.PropertyT("supportedAggregationTypes"), out var __jsonSupportedAggregationTypes) ? If( __jsonSupportedAggregationTypes as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _supportedAggregationType;} + {_supportedTimeGrainType = If( json?.PropertyT("supportedTimeGrainTypes"), out var __jsonSupportedTimeGrainTypes) ? If( __jsonSupportedTimeGrainTypes as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _supportedTimeGrainType;} + {_fillGapWithZero = If( json?.PropertyT("fillGapWithZero"), out var __jsonFillGapWithZero) ? (bool?)__jsonFillGapWithZero : _fillGapWithZero;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricDimension) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricDimension.FromJson(__k) )) ))() : null : _dimension;} + {_enableRegionalMdmAccount = If( json?.PropertyT("enableRegionalMdmAccount"), out var __jsonEnableRegionalMdmAccount) ? (string)__jsonEnableRegionalMdmAccount : (string)_enableRegionalMdmAccount;} + {_sourceMdmAccount = If( json?.PropertyT("sourceMdmAccount"), out var __jsonSourceMdmAccount) ? (string)__jsonSourceMdmAccount : (string)_sourceMdmAccount;} + {_sourceMdmNamespace = If( json?.PropertyT("sourceMdmNamespace"), out var __jsonSourceMdmNamespace) ? (string)__jsonSourceMdmNamespace : (string)_sourceMdmNamespace;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.PowerShell.cs similarity index 86% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.PowerShell.cs index 20748ee73fb1..2f76ffa4a27d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class NetAppVolume partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.INetAppVolume DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new NetAppVolume(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.VMware.Models.Api20211201.INetAppVolume DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new NetAppVolume(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetA /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,13 +111,13 @@ internal NetAppVolume(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal)this).Id, 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,7 +132,7 @@ internal NetAppVolume(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal)this).Id, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.TypeConverter.cs index ebe567e1c165..a2e9800fe733 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.INetAppVolume ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.cs b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.cs similarity index 86% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.cs rename to src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.cs index dbeea156041a..055c04cf4066 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An Azure NetApp Files volume from Microsoft.NetApp provider public partial class NetAppVolume : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolumeInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolumeInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface INetAppVolume : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure resource ID of the NetApp volume", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.json.cs index cc90bd0a1eb4..f08914eb0986 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/NetAppVolume.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/NetAppVolume.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class NetAppVolume partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.INetAppVolume FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.INetAppVolume FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new NetAppVolume(json) : null; } @@ -77,7 +75,7 @@ internal NetAppVolume(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Jso { return; } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 54% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Operation.PowerShell.cs index 3861b3bb05b3..b266f2a567bf 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.PowerShell.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Operation partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOper /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,57 +111,57 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecificationTypeConverter.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. @@ -176,51 +176,51 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("IsDataAction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("Origin")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).Origin, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); } if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecificationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Operation.TypeConverter.cs index 390490690e28..37c01decb47f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.TypeConverter.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.cs b/src/VMware/VMware.Autorest/generated/api/Models/Operation.cs similarity index 64% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Operation.cs index 1aa54c95ea1b..8d4f816954a0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Operation.cs @@ -3,38 +3,38 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A REST API operation public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay _display; /// Contains the localized display information for this operation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplay()); } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplay()); } /// Localized friendly description for the operation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Description; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Description; } /// Localized friendly name for the operation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Operation; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Operation; } /// Localized friendly form of the resource provider name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Provider; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Provider; } /// Localized friendly form of the resource type related to this operation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Resource; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Resource; } /// Backing field for property. private bool? _isDataAction; @@ -44,28 +44,28 @@ public partial class Operation : public bool? IsDataAction { get => this._isDataAction; set => this._isDataAction = value; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplay()); set { {_display = value;} } } /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Description = value; } /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Operation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Operation = value; } /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Provider = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Provider = value; } /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)Display).Resource = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)Display).Resource = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationProperties()); set { {_property = value;} } } /// Internal Acessors for ServiceSpecification - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationInternal.ServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)Property).ServiceSpecification = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationInternal.ServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)Property).ServiceSpecification = value; } /// Backing field for property. private string _name; @@ -82,19 +82,19 @@ public partial class Operation : public string Origin { get => this._origin; set => this._origin = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties _property; /// Properties of the operation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationProperties()); set => this._property = value; } /// Specifications of the Log for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)Property).ServiceSpecificationLogSpecification = value ?? null /* arrayOf */; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification = value ?? null /* arrayOf */; } /// Creates an new instance. public Operation() @@ -110,6 +110,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly description for the operation", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +121,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly name for the operation", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +132,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly form of the resource provider name", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +143,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly form of the resource type related to this operation", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +154,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gets or sets a value indicating whether the operation is a data action or not", SerializedName = @"isDataAction", PossibleTypes = new [] { typeof(bool) })] @@ -150,6 +165,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Name of the operation being performed on this object", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +176,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Origin of the operation", SerializedName = @"origin", PossibleTypes = new [] { typeof(string) })] @@ -166,18 +187,24 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifications of the Log for Azure Monitoring", SerializedName = @"logSpecifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification) })] + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifications of the Metrics for Azure Monitoring", SerializedName = @"metricSpecifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification) })] + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } /// A REST API operation @@ -185,7 +212,7 @@ internal partial interface IOperationInternal { /// Contains the localized display information for this operation - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay Display { get; set; } /// Localized friendly description for the operation string DisplayDescription { get; set; } /// Localized friendly name for the operation @@ -201,13 +228,13 @@ internal partial interface IOperationInternal /// Origin of the operation string Origin { get; set; } /// Properties of the operation - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties Property { get; set; } /// Service specifications of the operation - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification ServiceSpecification { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification ServiceSpecification { get; set; } /// Specifications of the Log for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Operation.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Operation.json.cs index 89a72ec51c3d..9899ad2f0b95 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Operation.json.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,11 +75,11 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonOb { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationProperties.FromJson(__jsonProperties) : Property;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationProperties.FromJson(__jsonProperties) : _property;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : _isDataAction;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} AfterFromJson(json); } @@ -104,12 +102,12 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index da28c7700e31..68fc85c266cd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.PowerShell.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationDisplay partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOper /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -144,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index a6ff4889711a..3a98804079a5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.TypeConverter.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.cs similarity index 85% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.cs index 67b8c6c00c80..f1a42d274ec6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Contains the localized display information for this operation public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal { /// Backing field for property. @@ -21,16 +21,16 @@ public partial class OperationDisplay : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } /// Backing field for property. private string _operation; @@ -67,6 +67,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly description for the operation", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly name for the operation", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly form of the resource provider name", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +100,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Localized friendly form of the resource type related to this operation", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationDisplay.json.cs index d8e969955e17..1c05ac2ebcc8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationDisplay.json.cs +++ b/src/VMware/VMware.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json { 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); } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationList.PowerShell.cs index 0a7f8fb56b64..f21e0ff67267 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationList(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.VMware.Models.Api20211201.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOper /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal OperationList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).NextLink, 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,11 +136,11 @@ internal OperationList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationList.TypeConverter.cs index 482d6ac5d904..0a0c6fee8515 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationList.cs index 22111bc3e1b5..745b680fa702 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Pageable list of operations public partial class OperationList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class OperationList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[] _value; + private System.Collections.Generic.List _value; /// List of operations [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public OperationList() @@ -47,6 +47,9 @@ public partial interface IOperationList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IOperationList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of operations", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation) })] + System.Collections.Generic.List Value { get; } } /// Pageable list of operations @@ -68,7 +74,7 @@ internal partial interface IOperationListInternal /// URL to get the next page if any string NextLink { get; set; } /// List of operations - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationList.json.cs index 3e4a98af52ad..5b5a840f481b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class OperationList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationList. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new OperationList(json) : null; } @@ -77,8 +75,8 @@ internal OperationList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Operation.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.VMware.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.VMware.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.PowerShell.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.PowerShell.cs index 38bf1430a1ed..d4a81858530a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class OperationProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IOperationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationProperties(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.VMware.Models.Api20211201.IOperationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOper /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,21 +111,21 @@ internal OperationProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecificationTypeConverter.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. @@ -140,15 +140,15 @@ internal OperationProperties(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("ServiceSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecificationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecificationTypeConverter.ConvertFrom); } if (content.Contains("ServiceSpecificationLogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[]) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationLogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationLogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("ServiceSpecificationMetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecificationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.TypeConverter.cs index a535477604e0..00655f95cfcb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.cs similarity index 50% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.cs index 67eb4c2d564a..126a551782f1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.cs @@ -3,33 +3,33 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Extra Operation properties public partial class OperationProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal { /// Internal Acessors for ServiceSpecification - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecification()); set { {_serviceSpecification = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecification()); set { {_serviceSpecification = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification _serviceSpecification; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification _serviceSpecification; /// Service specifications of the operation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecification()); set => this._serviceSpecification = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecification()); set => this._serviceSpecification = value; } /// Specifications of the Log for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)ServiceSpecification).LogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)ServiceSpecification).LogSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationLogSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)ServiceSpecification).LogSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)ServiceSpecification).LogSpecification = value ?? null /* arrayOf */; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification = value ?? null /* arrayOf */; } /// Creates an new instance. public OperationProperties() @@ -45,18 +45,24 @@ public partial interface IOperationProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifications of the Log for Azure Monitoring", SerializedName = @"logSpecifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification) })] + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifications of the Metrics for Azure Monitoring", SerializedName = @"metricSpecifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification) })] + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } /// Extra Operation properties @@ -64,11 +70,11 @@ internal partial interface IOperationPropertiesInternal { /// Service specifications of the operation - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification ServiceSpecification { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification ServiceSpecification { get; set; } /// Specifications of the Log for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] ServiceSpecificationLogSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationLogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + System.Collections.Generic.List ServiceSpecificationMetricSpecification { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.json.cs index 91f4bca7c8f0..6ee3cac6d597 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/OperationProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/OperationProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new OperationProperties(json) : null; } @@ -77,7 +77,7 @@ internal OperationProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ServiceSpecification.FromJson(__jsonServiceSpecification) : ServiceSpecification;} + {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ServiceSpecification.FromJson(__jsonServiceSpecification) : _serviceSpecification;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.PowerShell.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.PowerShell.cs index 21a7897d621e..5b03de24a0ad 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PlacementPoliciesList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPlacementPoliciesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PlacementPoliciesList(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.VMware.Models.Api20211201.IPlacementPoliciesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PlacementPoliciesList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlac /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal PlacementPoliciesList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).NextLink, 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,11 +136,11 @@ internal PlacementPoliciesList(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.TypeConverter.cs index e1a7409ca5ca..6e74aa17f77c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPoliciesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.cs index e71b3238de74..c2c3a3181e5b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Represents list of placement policies public partial class PlacementPoliciesList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class PlacementPoliciesList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public PlacementPoliciesList() @@ -47,6 +47,9 @@ public partial interface IPlacementPoliciesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IPlacementPoliciesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy) })] + System.Collections.Generic.List Value { get; } } /// Represents list of placement policies @@ -68,7 +74,7 @@ internal partial interface IPlacementPoliciesListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.json.cs index a384e28f552c..13ded62cfe01 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPoliciesList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPoliciesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PlacementPoliciesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPoliciesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PlacementPoliciesList(json) : null; } @@ -77,8 +77,8 @@ internal PlacementPoliciesList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy.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.VMware.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.VMware.Models.IPlacementPolicy) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.PowerShell.cs similarity index 74% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.PowerShell.cs index bdace9e717b7..4447b03c94f9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PlacementPolicy partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPlacementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PlacementPolicy(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.VMware.Models.Api20211201.IPlacementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PlacementPolicy(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlac /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,25 +111,25 @@ internal PlacementPolicy(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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,19 +144,19 @@ internal PlacementPolicy(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.TypeConverter.cs index c028bd9aa93a..d404afcc56b9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.cs index 0e42d668628a..6e921aeabeb8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.cs @@ -3,45 +3,44 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A vSphere Distributed Resource Scheduler (DRS) placement policy public partial class PlacementPolicy : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties _property; /// placement policy properties [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -49,7 +48,7 @@ public partial class PlacementPolicy : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public PlacementPolicy() @@ -72,24 +71,27 @@ public PlacementPolicy() /// A vSphere Distributed Resource Scheduler (DRS) placement policy public partial interface IPlacementPolicy : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// placement policy properties [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"placement policy properties", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties Property { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get; set; } } /// A vSphere Distributed Resource Scheduler (DRS) placement policy internal partial interface IPlacementPolicyInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// placement policy properties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.json.cs index 4c5026db1741..f8ecdd6434c9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicy.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicy.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PlacementPolicy partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PlacementPolicy(json) : null; } @@ -77,8 +77,8 @@ internal PlacementPolicy(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json. { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.PowerShell.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.PowerShell.cs index afaf6422fd7f..dce7234c04fd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PlacementPolicyProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPlacementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PlacementPolicyProperties(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.VMware.Models.Api20211201.IPlacementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PlacementPolicyProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlac /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,25 +111,25 @@ internal PlacementPolicyProperties(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState, 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,19 +144,19 @@ internal PlacementPolicyProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.TypeConverter.cs index dc5fc61a9124..93206f4c091b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.cs similarity index 62% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.cs index 62dca248433f..5eb23ca6dfa4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Abstract placement policy properties public partial class PlacementPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal { /// Backing field for property. @@ -21,28 +21,28 @@ public partial class PlacementPolicyProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? _state; + private string _state; /// Whether the placement policy is enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get => this._state; set => this._state = value; } + public string State { get => this._state; set => this._state = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType _type; + private string _type; /// placement policy type [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public PlacementPolicyProperties() @@ -58,6 +58,9 @@ public partial interface IPlacementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the placement policy", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -66,26 +69,38 @@ public partial interface IPlacementPolicyProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// Whether the placement policy is enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether the placement policy is enabled or disabled", SerializedName = @"state", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string State { get; set; } /// placement policy type [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"placement policy type", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] + string Type { get; set; } } /// Abstract placement policy properties @@ -95,11 +110,14 @@ internal partial interface IPlacementPolicyPropertiesInternal /// Display name of the placement policy string DisplayName { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// Whether the placement policy is enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string State { get; set; } /// placement policy type - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("VmVm", "VmHost")] + string Type { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.json.cs index 100d6cf8b470..2dd7eb668a26 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,15 +54,15 @@ public partial class PlacementPolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties interface is polymorphic, and the + /// precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json)) { @@ -96,10 +96,10 @@ internal PlacementPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } @@ -125,7 +125,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.PowerShell.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.PowerShell.cs index 8107e4cf2cb0..b4813d35d29b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PlacementPolicyUpdate partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPlacementPolicyUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PlacementPolicyUpdate(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.VMware.Models.Api20211201.IPlacementPolicyUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PlacementPolicyUpdate(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlac /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,25 +111,33 @@ internal PlacementPolicyUpdate(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdatePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AffinityStrength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AffinityStrength = (string) content.GetValueForProperty("AffinityStrength",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AffinityStrength, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).State, global::System.Convert.ToString); } if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("HostMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).HostMember = (string[]) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).HostMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).HostMember = (System.Collections.Generic.List) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).HostMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AzureHybridBenefitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AzureHybridBenefitType = (string) content.GetValueForProperty("AzureHybridBenefitType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AzureHybridBenefitType, 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,19 +152,27 @@ internal PlacementPolicyUpdate(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdatePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdatePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AffinityStrength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AffinityStrength = (string) content.GetValueForProperty("AffinityStrength",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AffinityStrength, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).State, global::System.Convert.ToString); } if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("HostMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).HostMember = (string[]) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateInternal)this).HostMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).HostMember = (System.Collections.Generic.List) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).HostMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AzureHybridBenefitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AzureHybridBenefitType = (string) content.GetValueForProperty("AzureHybridBenefitType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal)this).AzureHybridBenefitType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.TypeConverter.cs index 33e8fdd80704..feb4e2918b96 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicyUpdate ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.cs new file mode 100644 index 000000000000..64161cd94809 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.cs @@ -0,0 +1,137 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// An update of a DRS placement policy resource + public partial class PlacementPolicyUpdate : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal + { + + /// vm-host placement policy affinity strength (should/must) + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string AffinityStrength { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).AffinityStrength; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).AffinityStrength = value ?? null; } + + /// placement policy azure hybrid benefit opt-in type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string AzureHybridBenefitType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).AzureHybridBenefitType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).AzureHybridBenefitType = value ?? null; } + + /// Host members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HostMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).HostMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).HostMember = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdateProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties _property; + + /// The properties of a placement policy resource that may be updated + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdateProperties()); set => this._property = value; } + + /// Whether the placement policy is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).State = value ?? null; } + + /// Virtual machine members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List VMMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).VMMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)Property).VMMember = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public PlacementPolicyUpdate() + { + + } + } + /// An update of a DRS placement policy resource + public partial interface IPlacementPolicyUpdate : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// vm-host placement policy affinity strength (should/must) + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + string AffinityStrength { get; set; } + /// placement policy azure hybrid benefit opt-in type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + string AzureHybridBenefitType { get; set; } + /// Host members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Host members list", + SerializedName = @"hostMembers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HostMember { get; set; } + /// Whether the placement policy is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Whether the placement policy is enabled or disabled", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string State { get; set; } + /// Virtual machine members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Virtual machine members list", + SerializedName = @"vmMembers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VMMember { get; set; } + + } + /// An update of a DRS placement policy resource + internal partial interface IPlacementPolicyUpdateInternal + + { + /// vm-host placement policy affinity strength (should/must) + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + string AffinityStrength { get; set; } + /// placement policy azure hybrid benefit opt-in type + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + string AzureHybridBenefitType { get; set; } + /// Host members list + System.Collections.Generic.List HostMember { get; set; } + /// The properties of a placement policy resource that may be updated + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties Property { get; set; } + /// Whether the placement policy is enabled or disabled + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string State { get; set; } + /// Virtual machine members list + System.Collections.Generic.List VMMember { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.json.cs index 578d1c5e4d08..1a907a65957b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdate.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PlacementPolicyUpdate partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PlacementPolicyUpdate(json) : null; } @@ -77,7 +77,7 @@ internal PlacementPolicyUpdate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdateProperties.FromJson(__jsonProperties) : Property;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdateProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.PowerShell.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.PowerShell.cs index 4c5cebfeadff..c79c9bd333bd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class PlacementPolicyUpdateProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PlacementPolicyUpdateProperties(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.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PlacementPolicyUpdateProperties(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlac /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -113,21 +111,29 @@ internal PlacementPolicyUpdateProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("HostMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).HostMember = (string[]) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).HostMember = (System.Collections.Generic.List) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AffinityStrength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AffinityStrength = (string) content.GetValueForProperty("AffinityStrength",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AffinityStrength, global::System.Convert.ToString); + } + if (content.Contains("AzureHybridBenefitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AzureHybridBenefitType = (string) content.GetValueForProperty("AzureHybridBenefitType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AzureHybridBenefitType, 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. @@ -142,15 +148,23 @@ internal PlacementPolicyUpdateProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("HostMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).HostMember = (string[]) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdatePropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).HostMember = (System.Collections.Generic.List) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AffinityStrength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AffinityStrength = (string) content.GetValueForProperty("AffinityStrength",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AffinityStrength, global::System.Convert.ToString); + } + if (content.Contains("AzureHybridBenefitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AzureHybridBenefitType = (string) content.GetValueForProperty("AzureHybridBenefitType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal)this).AzureHybridBenefitType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.TypeConverter.cs index becf87ca3994..f4daf53faca8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.cs new file mode 100644 index 000000000000..026b7067fbc6 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.cs @@ -0,0 +1,140 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// The properties of a placement policy resource that may be updated + public partial class PlacementPolicyUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdatePropertiesInternal + { + + /// Backing field for property. + private string _affinityStrength; + + /// vm-host placement policy affinity strength (should/must) + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string AffinityStrength { get => this._affinityStrength; set => this._affinityStrength = value; } + + /// Backing field for property. + private string _azureHybridBenefitType; + + /// placement policy azure hybrid benefit opt-in type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string AzureHybridBenefitType { get => this._azureHybridBenefitType; set => this._azureHybridBenefitType = value; } + + /// Backing field for property. + private System.Collections.Generic.List _hostMember; + + /// Host members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List HostMember { get => this._hostMember; set => this._hostMember = value; } + + /// Backing field for property. + private string _state; + + /// Whether the placement policy is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private System.Collections.Generic.List _vMMember; + + /// Virtual machine members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List VMMember { get => this._vMMember; set => this._vMMember = value; } + + /// Creates an new instance. + public PlacementPolicyUpdateProperties() + { + + } + } + /// The properties of a placement policy resource that may be updated + public partial interface IPlacementPolicyUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// vm-host placement policy affinity strength (should/must) + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + string AffinityStrength { get; set; } + /// placement policy azure hybrid benefit opt-in type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + string AzureHybridBenefitType { get; set; } + /// Host members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Host members list", + SerializedName = @"hostMembers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HostMember { get; set; } + /// Whether the placement policy is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Whether the placement policy is enabled or disabled", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string State { get; set; } + /// Virtual machine members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Virtual machine members list", + SerializedName = @"vmMembers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VMMember { get; set; } + + } + /// The properties of a placement policy resource that may be updated + internal partial interface IPlacementPolicyUpdatePropertiesInternal + + { + /// vm-host placement policy affinity strength (should/must) + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + string AffinityStrength { get; set; } + /// placement policy azure hybrid benefit opt-in type + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + string AzureHybridBenefitType { get; set; } + /// Host members list + System.Collections.Generic.List HostMember { get; set; } + /// Whether the placement policy is enabled or disabled + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string State { get; set; } + /// Virtual machine members list + System.Collections.Generic.List VMMember { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.json.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.json.cs index ab59d73bdaa4..b7e0d7565dba 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PlacementPolicyUpdateProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PlacementPolicyUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PlacementPolicyUpdateProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PlacementPolicyUpdateProperties(json) : null; } @@ -77,9 +77,11 @@ internal PlacementPolicyUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.VMwa { return; } - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_vMMember = If( json?.PropertyT("vmMembers"), out var __jsonVMMembers) ? If( __jsonVMMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : VMMember;} - {_hostMember = If( json?.PropertyT("hostMembers"), out var __jsonHostMembers) ? If( __jsonHostMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : HostMember;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_vMMember = If( json?.PropertyT("vmMembers"), out var __jsonVMMembers) ? If( __jsonVMMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _vMMember;} + {_hostMember = If( json?.PropertyT("hostMembers"), out var __jsonHostMembers) ? If( __jsonHostMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _hostMember;} + {_affinityStrength = If( json?.PropertyT("affinityStrength"), out var __jsonAffinityStrength) ? (string)__jsonAffinityStrength : (string)_affinityStrength;} + {_azureHybridBenefitType = If( json?.PropertyT("azureHybridBenefitType"), out var __jsonAzureHybridBenefitType) ? (string)__jsonAzureHybridBenefitType : (string)_azureHybridBenefitType;} AfterFromJson(json); } @@ -121,6 +123,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } container.Add("hostMembers",__r); } + AddIf( null != (((object)this._affinityStrength)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._affinityStrength.ToString()) : null, "affinityStrength" ,container.Add ); + AddIf( null != (((object)this._azureHybridBenefitType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._azureHybridBenefitType.ToString()) : null, "azureHybridBenefitType" ,container.Add ); AfterToJson(ref container); return container; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.PowerShell.cs new file mode 100644 index 000000000000..de48c6b2b1c9 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.PowerShell.cs @@ -0,0 +1,620 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// A private cloud resource + [System.ComponentModel.TypeConverter(typeof(PrivateCloudTypeConverter))] + public partial class PrivateCloud + { + + /// + /// 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.VMware.Models.IPrivateCloud DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateCloud(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.VMware.Models.IPrivateCloud DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateCloud(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.VMware.Models.IPrivateCloud FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateCloud(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Circuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecondaryCircuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("NetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NetworkBlock, global::System.Convert.ToString); + } + if (content.Contains("ManagementNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementNetwork, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningNetwork, global::System.Convert.ToString); + } + if (content.Contains("VmotionNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VmotionNetwork, global::System.Convert.ToString); + } + if (content.Contains("VcenterPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterPassword, global::System.Convert.ToString); + } + if (content.Contains("NsxtPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtPassword, global::System.Convert.ToString); + } + if (content.Contains("VcenterCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("NsxtCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("ExternalCloudLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExternalCloudLink = (System.Collections.Generic.List) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NsxPublicIPQuotaRaised")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxPublicIPQuotaRaised = (string) content.GetValueForProperty("NsxPublicIPQuotaRaised",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxPublicIPQuotaRaised, global::System.Convert.ToString); + } + if (content.Contains("CircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("CircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("EndpointNsxtManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointNsxtManager, global::System.Convert.ToString); + } + if (content.Contains("EndpointVcsa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointVcsa, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); + } + if (content.Contains("EndpointHcxCloudManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyVersionType, 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 PrivateCloud(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SkuName = (string) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SkuName, global::System.Convert.ToString); + } + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Circuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SecondaryCircuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("NetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NetworkBlock, global::System.Convert.ToString); + } + if (content.Contains("ManagementNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementNetwork, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ProvisioningNetwork, global::System.Convert.ToString); + } + if (content.Contains("VmotionNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VmotionNetwork, global::System.Convert.ToString); + } + if (content.Contains("VcenterPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterPassword, global::System.Convert.ToString); + } + if (content.Contains("NsxtPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtPassword, global::System.Convert.ToString); + } + if (content.Contains("VcenterCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("NsxtCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("ExternalCloudLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExternalCloudLink = (System.Collections.Generic.List) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NsxPublicIPQuotaRaised")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxPublicIPQuotaRaised = (string) content.GetValueForProperty("NsxPublicIPQuotaRaised",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).NsxPublicIPQuotaRaised, global::System.Convert.ToString); + } + if (content.Contains("CircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("CircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("EndpointNsxtManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointNsxtManager, global::System.Convert.ToString); + } + if (content.Contains("EndpointVcsa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointVcsa, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); + } + if (content.Contains("EndpointHcxCloudManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal)this).KeyVaultPropertyVersionType, 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.VMware.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 private cloud resource + [System.ComponentModel.TypeConverter(typeof(PrivateCloudTypeConverter))] + public partial interface IPrivateCloud + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.TypeConverter.cs index b3fd9da351df..d0998c7a798a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.cs similarity index 54% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.cs index 11d7d9f44f6a..f5203505ec09 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.cs @@ -3,296 +3,319 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A private cloud resource public partial class PrivateCloud : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.TrackedResource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.TrackedResource(); /// The secondary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone = value ?? default(int); } + public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone = value ?? default(int); } /// The availability strategy for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); } + public string AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy = value ?? null; } /// The primary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone = value ?? default(int); } + public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone = value ?? default(int); } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitExpressRouteId; } + public string CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitExpressRouteId; } /// ExpressRoute Circuit private peering identifier [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitExpressRoutePrivatePeeringId; } + public string CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitExpressRoutePrivatePeeringId; } /// CIDR of primary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitPrimarySubnet; } + public string CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitPrimarySubnet; } /// CIDR of secondary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitSecondarySubnet; } + public string CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitSecondarySubnet; } /// Status of customer managed encryption key [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); } + public string EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus = value ?? null; } /// Endpoint for the HCX Cloud Manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointHcxCloudManager; } + public string EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointHcxCloudManager; } /// Endpoint for the NSX-T Data Center manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointNsxtManager; } + public string EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointNsxtManager; } /// Endpoint for Virtual Center Server Appliance [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointVcsa; } + public string EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointVcsa; } + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ExtendedNetworkBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ExtendedNetworkBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ExtendedNetworkBlock = value ?? null /* arrayOf */; } /// Array of cloud link IDs from other clouds that connect to this one [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] ExternalCloudLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ExternalCloudLink; } + public System.Collections.Generic.List ExternalCloudLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ExternalCloudLink; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity _identity; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity _identity; /// The identity of the private cloud, if configured. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity()); set => this._identity = value; } /// /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).PrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).PrincipalId; } /// vCenter Single Sign On Identity Sources [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource = value ?? null /* arrayOf */; } + public System.Collections.Generic.List IdentitySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource = value ?? null /* arrayOf */; } /// /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).TenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).TenantId; } /// /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The /// type 'None' will remove any identities from the Private Cloud. /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).Type = value ?? null; } /// Connectivity to internet is enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Internet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Internet = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum)""); } + public string Internet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Internet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Internet = value ?? null; } + + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyAutoDetectedKeyVersion; } /// The name of the key. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName = value ?? null; } + public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName = value ?? null; } /// The state of key provided [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; } + public string KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; } /// The URL of the vault. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl = value ?? null; } + public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl = value ?? null; } /// The version of the key. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion = value ?? null; } + public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion = value ?? null; } /// Property of the key if user provided or auto detected [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; } + public string KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; } /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost = value ?? null /* arrayOf */; } /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; } + public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; } + public string ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; } /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize = value ?? default(int); } + public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize = value ?? default(int); } /// Network used to access vCenter Server and NSX-T Manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ManagementNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ManagementNetwork; } + public string ManagementNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ManagementNetwork; } /// Internal Acessors for Availability - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Availability = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Availability = value; } /// Internal Acessors for Circuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Circuit { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).Circuit; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).Circuit = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Circuit { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).Circuit; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).Circuit = value; } /// Internal Acessors for CircuitExpressRouteId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitExpressRouteId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitExpressRouteId = value; } /// Internal Acessors for CircuitExpressRoutePrivatePeeringId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitExpressRoutePrivatePeeringId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitExpressRoutePrivatePeeringId = value; } /// Internal Acessors for CircuitPrimarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitPrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitPrimarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitPrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitPrimarySubnet = value; } /// Internal Acessors for CircuitSecondarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitSecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).CircuitSecondarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitSecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).CircuitSecondarySubnet = value; } /// Internal Acessors for Encryption - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).Encryption = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Encryption = value; } /// Internal Acessors for EncryptionKeyVaultProperty - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty = value; } /// Internal Acessors for Endpoint - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).Endpoint = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Endpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).Endpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).Endpoint = value; } /// Internal Acessors for EndpointHcxCloudManager - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointHcxCloudManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointHcxCloudManager = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointHcxCloudManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointHcxCloudManager = value; } /// Internal Acessors for EndpointNsxtManager - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointNsxtManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointNsxtManager = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointNsxtManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointNsxtManager = value; } /// Internal Acessors for EndpointVcsa - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointVcsa; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).EndpointVcsa = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointVcsa; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).EndpointVcsa = value; } /// Internal Acessors for ExternalCloudLink - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ExternalCloudLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ExternalCloudLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ExternalCloudLink = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ExternalCloudLink { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ExternalCloudLink; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ExternalCloudLink = value; } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity()); set { {_identity = value;} } } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).PrincipalId = value; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)Identity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for KeyVaultPropertyAutoDetectedKeyVersion + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyAutoDetectedKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyAutoDetectedKeyVersion = value; } /// Internal Acessors for KeyVaultPropertyKeyState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState = value; } /// Internal Acessors for KeyVaultPropertyVersionType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType = value; } /// Internal Acessors for ManagementCluster - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster = value; } /// Internal Acessors for ManagementClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId = value; } /// Internal Acessors for ManagementClusterProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState = value; } /// Internal Acessors for ManagementNetwork - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ManagementNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ManagementNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ManagementNetwork = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ManagementNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ManagementNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ManagementNetwork = value; } + + /// Internal Acessors for NsxPublicIPQuotaRaised + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.NsxPublicIPQuotaRaised { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxPublicIPQuotaRaised; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxPublicIPQuotaRaised = value; } /// Internal Acessors for NsxtCertificateThumbprint - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.NsxtCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NsxtCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NsxtCertificateThumbprint = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.NsxtCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxtCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxtCertificateThumbprint = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningNetwork - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ProvisioningNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ProvisioningNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ProvisioningNetwork = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ProvisioningNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ProvisioningNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ProvisioningNetwork = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for SecondaryCircuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.SecondaryCircuit { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuit; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuit = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.SecondaryCircuit { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuit; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuit = value; } /// Internal Acessors for SecondaryCircuitExpressRouteId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRouteId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRouteId = value; } /// Internal Acessors for SecondaryCircuitExpressRoutePrivatePeeringId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRoutePrivatePeeringId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRoutePrivatePeeringId = value; } /// Internal Acessors for SecondaryCircuitPrimarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitPrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitPrimarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitPrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitPrimarySubnet = value; } /// Internal Acessors for SecondaryCircuitSecondarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitSecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitSecondarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitSecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitSecondarySubnet = value; } /// Internal Acessors for Sku - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku()); set { {_sku = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku()); set { {_sku = value;} } } /// Internal Acessors for VcenterCertificateThumbprint - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.VcenterCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VcenterCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VcenterCertificateThumbprint = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.VcenterCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VcenterCertificateThumbprint; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VcenterCertificateThumbprint = value; } /// Internal Acessors for VmotionNetwork - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudInternal.VmotionNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VmotionNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VmotionNetwork = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudInternal.VmotionNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VmotionNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VmotionNetwork = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Name; } /// /// The block of addresses should be unique across VNet in your subscription as well as on-premise. Make sure the CIDR format /// is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22 /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string NetworkBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NetworkBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NetworkBlock = value ?? null; } + public string NetworkBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NetworkBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NetworkBlock = value ?? null; } + + /// + /// Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024 + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string NsxPublicIPQuotaRaised { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxPublicIPQuotaRaised; } /// Thumbprint of the NSX-T Manager SSL certificate [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string NsxtCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NsxtCertificateThumbprint; } + public string NsxtCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxtCertificateThumbprint; } /// Optionally, set the NSX-T Manager password when the private cloud is created [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string NsxtPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NsxtPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).NsxtPassword = value ?? null; } + public string NsxtPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxtPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).NsxtPassword = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties _property; /// The properties of a private cloud resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudProperties()); set => this._property = value; } /// Used for virtual machine cold migration, cloning, and snapshot migration [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ProvisioningNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ProvisioningNetwork; } + public string ProvisioningNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ProvisioningNetwork; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -300,50 +323,50 @@ public partial class PrivateCloud : /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRouteId; } + public string SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRouteId; } /// ExpressRoute Circuit private peering identifier [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRoutePrivatePeeringId; } + public string SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitExpressRoutePrivatePeeringId; } /// CIDR of primary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitPrimarySubnet; } + public string SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitPrimarySubnet; } /// CIDR of secondary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitSecondarySubnet; } + public string SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).SecondaryCircuitSecondarySubnet; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku _sku; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku _sku; /// The private cloud SKU [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku()); set => this._sku = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku()); set => this._sku = value; } /// The name of the SKU. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)Sku).Name = value ; } + public string SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)Sku).Name = value ; } /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__trackedResource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__trackedResource).Type; } /// Thumbprint of the vCenter Server SSL certificate [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string VcenterCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VcenterCertificateThumbprint; } + public string VcenterCertificateThumbprint { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VcenterCertificateThumbprint; } /// Optionally, set the vCenter admin password when the private cloud is created [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string VcenterPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VcenterPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VcenterPassword = value ?? null; } + public string VcenterPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VcenterPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VcenterPassword = value ?? null; } /// Used for live migration of virtual machines [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string VmotionNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal)Property).VmotionNetwork; } + public string VmotionNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)Property).VmotionNetwork; } /// Creates an new instance. public PrivateCloud() @@ -366,12 +389,15 @@ public PrivateCloud() /// A private cloud resource public partial interface IPrivateCloud : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource { /// The secondary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The secondary availability zone for the private cloud", SerializedName = @"secondaryZone", PossibleTypes = new [] { typeof(int) })] @@ -380,14 +406,21 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The availability strategy for the private cloud", SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string AvailabilityStrategy { get; set; } /// The primary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The primary availability zone for the private cloud", SerializedName = @"zone", PossibleTypes = new [] { typeof(int) })] @@ -396,6 +429,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the ExpressRoute Circuit (Microsoft Colo only)", SerializedName = @"expressRouteID", PossibleTypes = new [] { typeof(string) })] @@ -404,6 +440,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ExpressRoute Circuit private peering identifier", SerializedName = @"expressRoutePrivatePeeringID", PossibleTypes = new [] { typeof(string) })] @@ -412,6 +451,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of primary subnet", SerializedName = @"primarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -420,6 +462,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of secondary subnet", SerializedName = @"secondarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -428,14 +473,21 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Status of customer managed encryption key", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string EncryptionStatus { get; set; } /// Endpoint for the HCX Cloud Manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for the HCX Cloud Manager", SerializedName = @"hcxCloudManager", PossibleTypes = new [] { typeof(string) })] @@ -444,6 +496,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for the NSX-T Data Center manager", SerializedName = @"nsxtManager", PossibleTypes = new [] { typeof(string) })] @@ -452,24 +507,48 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for Virtual Center Server Appliance", SerializedName = @"vcsa", PossibleTypes = new [] { typeof(string) })] string EndpointVcsa { get; } + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).", + SerializedName = @"extendedNetworkBlocks", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ExtendedNetworkBlock { get; set; } /// Array of cloud link IDs from other clouds that connect to this one [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Array of cloud link IDs from other clouds that connect to this one", SerializedName = @"externalCloudLinks", PossibleTypes = new [] { typeof(string) })] - string[] ExternalCloudLink { get; } + System.Collections.Generic.List ExternalCloudLink { get; } /// /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of private cloud identity. This property will only be provided for a system assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -478,16 +557,22 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"vCenter Single Sign On Identity Sources", SerializedName = @"identitySources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource) })] + System.Collections.Generic.List IdentitySource { get; set; } /// /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -499,22 +584,44 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string IdentityType { get; set; } /// Connectivity to internet is enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Connectivity to internet is enabled or disabled", SerializedName = @"internet", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Internet { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The auto-detected version of the key if versionType is auto-detected.", + SerializedName = @"autoDetectedKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyAutoDetectedKeyVersion { get; } /// The name of the key. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the key.", SerializedName = @"keyName", PossibleTypes = new [] { typeof(string) })] @@ -523,14 +630,21 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of key provided", SerializedName = @"keyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; } /// The URL of the vault. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL of the vault.", SerializedName = @"keyVaultUrl", PossibleTypes = new [] { typeof(string) })] @@ -539,6 +653,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The version of the key.", SerializedName = @"keyVersion", PossibleTypes = new [] { typeof(string) })] @@ -547,22 +664,32 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Property of the key if user provided or auto detected", SerializedName = @"versionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - string[] ManagementClusterHost { get; set; } + System.Collections.Generic.List ManagementClusterHost { get; set; } /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity", SerializedName = @"clusterId", PossibleTypes = new [] { typeof(int) })] @@ -571,14 +698,21 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the cluster provisioning", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ManagementClusterProvisioningState { get; } /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The cluster size", SerializedName = @"clusterSize", PossibleTypes = new [] { typeof(int) })] @@ -587,6 +721,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Network used to access vCenter Server and NSX-T Manager", SerializedName = @"managementNetwork", PossibleTypes = new [] { typeof(string) })] @@ -598,14 +735,34 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The block of addresses should be unique across VNet in your subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22", SerializedName = @"networkBlock", PossibleTypes = new [] { typeof(string) })] string NetworkBlock { get; set; } + /// + /// Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024 + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024", + SerializedName = @"nsxPublicIpQuotaRaised", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string NsxPublicIPQuotaRaised { get; } /// Thumbprint of the NSX-T Manager SSL certificate [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Thumbprint of the NSX-T Manager SSL certificate", SerializedName = @"nsxtCertificateThumbprint", PossibleTypes = new [] { typeof(string) })] @@ -614,6 +771,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optionally, set the NSX-T Manager password when the private cloud is created", SerializedName = @"nsxtPassword", PossibleTypes = new [] { typeof(string) })] @@ -622,6 +782,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Used for virtual machine cold migration, cloning, and snapshot migration", SerializedName = @"provisioningNetwork", PossibleTypes = new [] { typeof(string) })] @@ -630,14 +793,21 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the ExpressRoute Circuit (Microsoft Colo only)", SerializedName = @"expressRouteID", PossibleTypes = new [] { typeof(string) })] @@ -646,6 +816,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ExpressRoute Circuit private peering identifier", SerializedName = @"expressRoutePrivatePeeringID", PossibleTypes = new [] { typeof(string) })] @@ -654,6 +827,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of primary subnet", SerializedName = @"primarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -662,6 +838,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of secondary subnet", SerializedName = @"secondarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -670,6 +849,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the SKU.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -678,6 +860,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Thumbprint of the vCenter Server SSL certificate", SerializedName = @"vcenterCertificateThumbprint", PossibleTypes = new [] { typeof(string) })] @@ -686,6 +871,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optionally, set the vCenter admin password when the private cloud is created", SerializedName = @"vcenterPassword", PossibleTypes = new [] { typeof(string) })] @@ -694,6 +882,9 @@ public partial interface IPrivateCloud : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Used for live migration of virtual machines", SerializedName = @"vmotionNetwork", PossibleTypes = new [] { typeof(string) })] @@ -702,18 +893,19 @@ public partial interface IPrivateCloud : } /// A private cloud resource internal partial interface IPrivateCloudInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal { /// Properties describing how the cloud is distributed across availability zones - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Availability { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Availability { get; set; } /// The secondary availability zone for the private cloud int? AvailabilitySecondaryZone { get; set; } /// The availability strategy for the private cloud - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string AvailabilityStrategy { get; set; } /// The primary availability zone for the private cloud int? AvailabilityZone { get; set; } /// An ExpressRoute Circuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Circuit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Circuit { get; set; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) string CircuitExpressRouteId { get; set; } /// ExpressRoute Circuit private peering identifier @@ -723,29 +915,36 @@ internal partial interface IPrivateCloudInternal : /// CIDR of secondary subnet string CircuitSecondarySubnet { get; set; } /// Customer managed key encryption, can be enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Encryption { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Encryption { get; set; } /// The key vault where the encryption key is stored - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get; set; } /// Status of customer managed encryption key - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string EncryptionStatus { get; set; } /// The endpoints - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints Endpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints Endpoint { get; set; } /// Endpoint for the HCX Cloud Manager string EndpointHcxCloudManager { get; set; } /// Endpoint for the NSX-T Data Center manager string EndpointNsxtManager { get; set; } /// Endpoint for Virtual Center Server Appliance string EndpointVcsa { get; set; } + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + System.Collections.Generic.List ExtendedNetworkBlock { get; set; } /// Array of cloud link IDs from other clouds that connect to this one - string[] ExternalCloudLink { get; set; } + System.Collections.Generic.List ExternalCloudLink { get; set; } /// The identity of the private cloud, if configured. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity Identity { get; set; } /// /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. /// string IdentityPrincipalId { get; set; } /// vCenter Single Sign On Identity Sources - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get; set; } + System.Collections.Generic.List IdentitySource { get; set; } /// /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. /// @@ -754,27 +953,34 @@ internal partial interface IPrivateCloudInternal : /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The /// type 'None' will remove any identities from the Private Cloud. /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string IdentityType { get; set; } /// Connectivity to internet is enabled or disabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Internet { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + string KeyVaultPropertyAutoDetectedKeyVersion { get; set; } /// The name of the key. string KeyVaultPropertyKeyName { get; set; } /// The state of key provided - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; set; } /// The URL of the vault. string KeyVaultPropertyKeyVaultUrl { get; set; } /// The version of the key. string KeyVaultPropertyKeyVersion { get; set; } /// Property of the key if user provided or auto detected - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; set; } /// The default cluster used for management - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties ManagementCluster { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster ManagementCluster { get; set; } /// The hosts - string[] ManagementClusterHost { get; set; } + System.Collections.Generic.List ManagementClusterHost { get; set; } /// The identity int? ManagementClusterId { get; set; } /// The state of the cluster provisioning - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ManagementClusterProvisioningState { get; set; } /// The cluster size int? ManagementClusterSize { get; set; } /// Network used to access vCenter Server and NSX-T Manager @@ -784,20 +990,26 @@ internal partial interface IPrivateCloudInternal : /// is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22 /// string NetworkBlock { get; set; } + /// + /// Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024 + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string NsxPublicIPQuotaRaised { get; set; } /// Thumbprint of the NSX-T Manager SSL certificate string NsxtCertificateThumbprint { get; set; } /// Optionally, set the NSX-T Manager password when the private cloud is created string NsxtPassword { get; set; } /// The properties of a private cloud resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties Property { get; set; } /// Used for virtual machine cold migration, cloning, and snapshot migration string ProvisioningNetwork { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// /// A secondary expressRoute circuit from a separate AZ. Only present in a stretched private cloud /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit SecondaryCircuit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit SecondaryCircuit { get; set; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) string SecondaryCircuitExpressRouteId { get; set; } /// ExpressRoute Circuit private peering identifier @@ -807,7 +1019,7 @@ internal partial interface IPrivateCloudInternal : /// CIDR of secondary subnet string SecondaryCircuitSecondarySubnet { get; set; } /// The private cloud SKU - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku Sku { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku Sku { get; set; } /// The name of the SKU. string SkuName { get; set; } /// Thumbprint of the vCenter Server SSL certificate diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.json.cs index 4f84dd23835c..5d7fd2b7ca1b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloud.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloud.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class PrivateCloud partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PrivateCloud(json) : null; } @@ -77,10 +75,10 @@ internal PrivateCloud(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Jso { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.TrackedResource(json); - {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Sku.FromJson(__jsonSku) : Sku;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudProperties.FromJson(__jsonProperties) : Property;} - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity.FromJson(__jsonIdentity) : Identity;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.TrackedResource(json); + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku.FromJson(__jsonSku) : _sku;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudProperties.FromJson(__jsonProperties) : _property;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity.FromJson(__jsonIdentity) : _identity;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.PowerShell.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.PowerShell.cs index b90166a393f6..b4b3f9510104 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PrivateCloudIdentity partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPrivateCloudIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateCloudIdentity(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.VMware.Models.Api20211201.IPrivateCloudIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateCloudIdentity(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPriv /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,21 +111,21 @@ internal PrivateCloudIdentity(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).Type, 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. @@ -140,15 +140,15 @@ internal PrivateCloudIdentity(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).TenantId, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.TypeConverter.cs index edb8a71954af..222532cc0a56 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudIdentity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.cs similarity index 82% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.cs index 73b04ef5c353..e7c284db84ce 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Identity for the virtual machine. public partial class PrivateCloudIdentity : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -38,14 +38,14 @@ public partial class PrivateCloudIdentity : public string TenantId { get => this._tenantId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? _type; + private string _type; /// /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The /// type 'None' will remove any identities from the Private Cloud. /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public PrivateCloudIdentity() @@ -63,6 +63,9 @@ public partial interface IPrivateCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The principal ID of private cloud identity. This property will only be provided for a system assigned identity.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +76,9 @@ public partial interface IPrivateCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -84,10 +90,14 @@ public partial interface IPrivateCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string Type { get; set; } } /// Identity for the virtual machine. @@ -106,7 +116,8 @@ internal partial interface IPrivateCloudIdentityInternal /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The /// type 'None' will remove any identities from the Private Cloud. /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string Type { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.json.cs index 8923759bc63e..3ef463087d18 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudIdentity.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudIdentity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateCloudIdentity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PrivateCloudIdentity(json) : null; } @@ -77,9 +77,9 @@ internal PrivateCloudIdentity(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime. { return; } - {_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;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -102,11 +102,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.PowerShell.cs index 2b4bc8e5eab8..6386c7b039a5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class PrivateCloudList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPrivateCloudList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PrivateCloudList(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.VMware.Models.Api20211201.IPrivateCloudList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PrivateCloudList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPriv /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal PrivateCloudList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).NextLink, 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,11 +136,11 @@ internal PrivateCloudList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.TypeConverter.cs index 85d0922691fe..fed5e6d320e8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.cs index ec915350f1d4..bd89924cf67e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A paged list of private clouds public partial class PrivateCloudList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class PrivateCloudList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public PrivateCloudList() @@ -47,6 +47,9 @@ public partial interface IPrivateCloudList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IPrivateCloudList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud) })] + System.Collections.Generic.List Value { get; } } /// A paged list of private clouds @@ -68,7 +74,7 @@ internal partial interface IPrivateCloudListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.json.cs index c4c2499f4060..556c156ee91b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateCloudList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PrivateCloudList(json) : null; } @@ -77,8 +77,8 @@ internal PrivateCloudList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud.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.VMware.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.VMware.Models.IPrivateCloud) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.PowerShell.cs new file mode 100644 index 000000000000..7df4fef40c99 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.PowerShell.cs @@ -0,0 +1,524 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// The properties of a private cloud resource + [System.ComponentModel.TypeConverter(typeof(PrivateCloudPropertiesTypeConverter))] + public partial class PrivateCloudProperties + { + + /// + /// 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.VMware.Models.IPrivateCloudProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateCloudProperties(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.VMware.Models.IPrivateCloudProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateCloudProperties(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.VMware.Models.IPrivateCloudProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateCloudProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Circuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryCircuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("NetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NetworkBlock, global::System.Convert.ToString); + } + if (content.Contains("ManagementNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ManagementNetwork, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork, global::System.Convert.ToString); + } + if (content.Contains("VmotionNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VmotionNetwork, global::System.Convert.ToString); + } + if (content.Contains("VcenterPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterPassword, global::System.Convert.ToString); + } + if (content.Contains("NsxtPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtPassword, global::System.Convert.ToString); + } + if (content.Contains("VcenterCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("NsxtCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("ExternalCloudLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ExternalCloudLink = (System.Collections.Generic.List) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NsxPublicIPQuotaRaised")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxPublicIPQuotaRaised = (string) content.GetValueForProperty("NsxPublicIPQuotaRaised",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxPublicIPQuotaRaised, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, global::System.Convert.ToString); + } + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("CircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("EndpointNsxtManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager, global::System.Convert.ToString); + } + if (content.Contains("EndpointVcsa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointVcsa, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); + } + if (content.Contains("EndpointHcxCloudManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, 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 PrivateCloudProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Circuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Circuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("Circuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Circuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("Endpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).Endpoint, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryCircuit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuit = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit) content.GetValueForProperty("SecondaryCircuit",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuit, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CircuitTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("NetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NetworkBlock = (string) content.GetValueForProperty("NetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NetworkBlock, global::System.Convert.ToString); + } + if (content.Contains("ManagementNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ManagementNetwork = (string) content.GetValueForProperty("ManagementNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ManagementNetwork, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork = (string) content.GetValueForProperty("ProvisioningNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ProvisioningNetwork, global::System.Convert.ToString); + } + if (content.Contains("VmotionNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VmotionNetwork = (string) content.GetValueForProperty("VmotionNetwork",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VmotionNetwork, global::System.Convert.ToString); + } + if (content.Contains("VcenterPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterPassword = (string) content.GetValueForProperty("VcenterPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterPassword, global::System.Convert.ToString); + } + if (content.Contains("NsxtPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtPassword = (string) content.GetValueForProperty("NsxtPassword",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtPassword, global::System.Convert.ToString); + } + if (content.Contains("VcenterCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint = (string) content.GetValueForProperty("VcenterCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).VcenterCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("NsxtCertificateThumbprint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint = (string) content.GetValueForProperty("NsxtCertificateThumbprint",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxtCertificateThumbprint, global::System.Convert.ToString); + } + if (content.Contains("ExternalCloudLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ExternalCloudLink = (System.Collections.Generic.List) content.GetValueForProperty("ExternalCloudLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).ExternalCloudLink, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NsxPublicIPQuotaRaised")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxPublicIPQuotaRaised = (string) content.GetValueForProperty("NsxPublicIPQuotaRaised",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).NsxPublicIPQuotaRaised, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, global::System.Convert.ToString); + } + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet = (string) content.GetValueForProperty("CircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("CircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet = (string) content.GetValueForProperty("CircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("EndpointNsxtManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager = (string) content.GetValueForProperty("EndpointNsxtManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointNsxtManager, global::System.Convert.ToString); + } + if (content.Contains("EndpointVcsa")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointVcsa = (string) content.GetValueForProperty("EndpointVcsa",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointVcsa, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId = (string) content.GetValueForProperty("CircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("CircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("CircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).CircuitExpressRoutePrivatePeeringId, global::System.Convert.ToString); + } + if (content.Contains("EndpointHcxCloudManager")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager = (string) content.GetValueForProperty("EndpointHcxCloudManager",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).EndpointHcxCloudManager, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitPrimarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet = (string) content.GetValueForProperty("SecondaryCircuitPrimarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitPrimarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitSecondarySubnet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet = (string) content.GetValueForProperty("SecondaryCircuitSecondarySubnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitSecondarySubnet, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRouteId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId = (string) content.GetValueForProperty("SecondaryCircuitExpressRouteId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRouteId, global::System.Convert.ToString); + } + if (content.Contains("SecondaryCircuitExpressRoutePrivatePeeringId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId = (string) content.GetValueForProperty("SecondaryCircuitExpressRoutePrivatePeeringId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal)this).SecondaryCircuitExpressRoutePrivatePeeringId, 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.VMware.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(); + } + } + /// The properties of a private cloud resource + [System.ComponentModel.TypeConverter(typeof(PrivateCloudPropertiesTypeConverter))] + public partial interface IPrivateCloudProperties + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.TypeConverter.cs index 1a9ec9d00932..df13996a178b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.cs similarity index 55% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.cs index a3e0d041a0d0..09c50d4428d1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.cs @@ -3,146 +3,158 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The properties of a private cloud resource public partial class PrivateCloudProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties __privateCloudUpdateProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties __privateCloudUpdateProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties(); /// Properties describing how the cloud is distributed across availability zones [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAvailabilityProperties Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Availability = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Availability = value ?? null /* model class */; } /// The secondary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilitySecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilitySecondaryZone = value ?? default(int); } + public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilitySecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilitySecondaryZone = value ?? default(int); } /// The availability strategy for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy? AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityStrategy = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); } + public string AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityStrategy = value ?? null; } /// The primary availability zone for the private cloud [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityZone = value ?? default(int); } + public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).AvailabilityZone = value ?? default(int); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit _circuit; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit _circuit; /// An ExpressRoute Circuit [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Circuit { get => (this._circuit = this._circuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit()); set => this._circuit = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Circuit { get => (this._circuit = this._circuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit()); set => this._circuit = value; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).ExpressRouteId; } + public string CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).ExpressRouteId; } /// ExpressRoute Circuit private peering identifier [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).ExpressRoutePrivatePeeringId; } + public string CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).ExpressRoutePrivatePeeringId; } /// CIDR of primary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).PrimarySubnet; } + public string CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).PrimarySubnet; } /// CIDR of secondary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).SecondarySubnet; } + public string CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).SecondarySubnet; } /// Customer managed key encryption, can be enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Encryption = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Encryption = value ?? null /* model class */; } /// The key vault where the encryption key is stored [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionKeyVaultProperty = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionKeyVaultProperty = value ?? null /* model class */; } /// Status of customer managed encryption key [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState? EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); } + public string EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionStatus = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints _endpoint; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints _endpoint; /// The endpoints [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints Endpoint { get => (this._endpoint = this._endpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Endpoints()); } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints Endpoint { get => (this._endpoint = this._endpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Endpoints()); } /// Endpoint for the HCX Cloud Manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).HcxCloudManager; } + public string EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).HcxCloudManager; } /// Endpoint for the NSX-T Data Center manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).NsxtManager; } + public string EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).NsxtManager; } /// Endpoint for Virtual Center Server Appliance [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).Vcsa; } + public string EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).Vcsa; } + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public System.Collections.Generic.List ExtendedNetworkBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ExtendedNetworkBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ExtendedNetworkBlock = value ?? null /* arrayOf */; } /// Backing field for property. - private string[] _externalCloudLink; + private System.Collections.Generic.List _externalCloudLink; /// Array of cloud link IDs from other clouds that connect to this one [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] ExternalCloudLink { get => this._externalCloudLink; } + public System.Collections.Generic.List ExternalCloudLink { get => this._externalCloudLink; } /// vCenter Single Sign On Identity Sources [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).IdentitySource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).IdentitySource = value ?? null /* arrayOf */; } + public System.Collections.Generic.List IdentitySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).IdentitySource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).IdentitySource = value ?? null /* arrayOf */; } /// Connectivity to internet is enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum? Internet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Internet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Internet = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum)""); } + public string Internet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Internet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Internet = value ?? null; } + + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyAutoDetectedKeyVersion; } /// The name of the key. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyName = value ?? null; } + public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyName = value ?? null; } /// The state of key provided [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyState; } + public string KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyState; } /// The URL of the vault. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVaultUrl = value ?? null; } + public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVaultUrl = value ?? null; } /// The version of the key. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVersion = value ?? null; } + public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyVersion = value ?? null; } /// Property of the key if user provided or auto detected [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyVersionType; } + public string KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyVersionType; } /// The default cluster used for management [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICommonClusterProperties ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementCluster = value ?? null /* model class */; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementCluster = value ?? null /* model class */; } /// The hosts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string[] ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterHost = value ?? null /* arrayOf */; } + public System.Collections.Generic.List ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterHost = value ?? null /* arrayOf */; } /// The identity [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterId; } + public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterId; } /// The state of the cluster provisioning [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterProvisioningState; } + public string ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterProvisioningState; } /// The cluster size [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterSize = value ?? default(int); } + public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterSize = value ?? default(int); } /// Backing field for property. private string _managementNetwork; @@ -152,79 +164,97 @@ public partial class PrivateCloudProperties : public string ManagementNetwork { get => this._managementNetwork; } /// Internal Acessors for Circuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.Circuit { get => (this._circuit = this._circuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit()); set { {_circuit = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.Circuit { get => (this._circuit = this._circuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit()); set { {_circuit = value;} } } /// Internal Acessors for CircuitExpressRouteId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).ExpressRouteId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.CircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).ExpressRouteId = value; } /// Internal Acessors for CircuitExpressRoutePrivatePeeringId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).ExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).ExpressRoutePrivatePeeringId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.CircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).ExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).ExpressRoutePrivatePeeringId = value; } /// Internal Acessors for CircuitPrimarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).PrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).PrimarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.CircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).PrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).PrimarySubnet = value; } /// Internal Acessors for CircuitSecondarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).SecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)Circuit).SecondarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.CircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).SecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)Circuit).SecondarySubnet = value; } /// Internal Acessors for Endpoint - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.Endpoint { get => (this._endpoint = this._endpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Endpoints()); set { {_endpoint = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.Endpoint { get => (this._endpoint = this._endpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Endpoints()); set { {_endpoint = value;} } } /// Internal Acessors for EndpointHcxCloudManager - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).HcxCloudManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).HcxCloudManager = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.EndpointHcxCloudManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).HcxCloudManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).HcxCloudManager = value; } /// Internal Acessors for EndpointNsxtManager - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).NsxtManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).NsxtManager = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.EndpointNsxtManager { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).NsxtManager; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).NsxtManager = value; } /// Internal Acessors for EndpointVcsa - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).Vcsa; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpointsInternal)Endpoint).Vcsa = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.EndpointVcsa { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).Vcsa; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpointsInternal)Endpoint).Vcsa = value; } /// Internal Acessors for ExternalCloudLink - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.ExternalCloudLink { get => this._externalCloudLink; set { {_externalCloudLink = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.ExternalCloudLink { get => this._externalCloudLink; set { {_externalCloudLink = value;} } } /// Internal Acessors for ManagementNetwork - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.ManagementNetwork { get => this._managementNetwork; set { {_managementNetwork = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.ManagementNetwork { get => this._managementNetwork; set { {_managementNetwork = value;} } } + + /// Internal Acessors for NsxPublicIPQuotaRaised + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.NsxPublicIPQuotaRaised { get => this._nsxPublicIPQuotaRaised; set { {_nsxPublicIPQuotaRaised = value;} } } /// Internal Acessors for NsxtCertificateThumbprint - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.NsxtCertificateThumbprint { get => this._nsxtCertificateThumbprint; set { {_nsxtCertificateThumbprint = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.NsxtCertificateThumbprint { get => this._nsxtCertificateThumbprint; set { {_nsxtCertificateThumbprint = value;} } } /// Internal Acessors for ProvisioningNetwork - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.ProvisioningNetwork { get => this._provisioningNetwork; set { {_provisioningNetwork = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.ProvisioningNetwork { get => this._provisioningNetwork; set { {_provisioningNetwork = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for SecondaryCircuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.SecondaryCircuit { get => (this._secondaryCircuit = this._secondaryCircuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit()); set { {_secondaryCircuit = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.SecondaryCircuit { get => (this._secondaryCircuit = this._secondaryCircuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit()); set { {_secondaryCircuit = value;} } } /// Internal Acessors for SecondaryCircuitExpressRouteId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).ExpressRouteId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).ExpressRouteId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).ExpressRouteId = value; } /// Internal Acessors for SecondaryCircuitExpressRoutePrivatePeeringId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).ExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).ExpressRoutePrivatePeeringId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).ExpressRoutePrivatePeeringId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).ExpressRoutePrivatePeeringId = value; } /// Internal Acessors for SecondaryCircuitPrimarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).PrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).PrimarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).PrimarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).PrimarySubnet = value; } /// Internal Acessors for SecondaryCircuitSecondarySubnet - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).SecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).SecondarySubnet = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).SecondarySubnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).SecondarySubnet = value; } /// Internal Acessors for VcenterCertificateThumbprint - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.VcenterCertificateThumbprint { get => this._vcenterCertificateThumbprint; set { {_vcenterCertificateThumbprint = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.VcenterCertificateThumbprint { get => this._vcenterCertificateThumbprint; set { {_vcenterCertificateThumbprint = value;} } } /// Internal Acessors for VmotionNetwork - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudPropertiesInternal.VmotionNetwork { get => this._vmotionNetwork; set { {_vmotionNetwork = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudPropertiesInternal.VmotionNetwork { get => this._vmotionNetwork; set { {_vmotionNetwork = value;} } } + + /// Internal Acessors for Availability + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Availability = value; } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).Encryption = value; } + + /// Internal Acessors for EncryptionKeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).EncryptionKeyVaultProperty = value; } + + /// Internal Acessors for KeyVaultPropertyAutoDetectedKeyVersion + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyAutoDetectedKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyAutoDetectedKeyVersion = value; } /// Internal Acessors for KeyVaultPropertyKeyState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyKeyState = value; } /// Internal Acessors for KeyVaultPropertyVersionType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyVersionType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).KeyVaultPropertyVersionType = value; } + + /// Internal Acessors for ManagementCluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementCluster = value; } /// Internal Acessors for ManagementClusterId - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterId = value; } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterId = value; } /// Internal Acessors for ManagementClusterProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)__privateCloudUpdateProperties).ManagementClusterProvisioningState = value; } /// Backing field for property. private string _networkBlock; @@ -236,6 +266,15 @@ public partial class PrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] public string NetworkBlock { get => this._networkBlock; set => this._networkBlock = value; } + /// Backing field for property. + private string _nsxPublicIPQuotaRaised; + + /// + /// Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024 + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string NsxPublicIPQuotaRaised { get => this._nsxPublicIPQuotaRaised; } + /// Backing field for property. private string _nsxtCertificateThumbprint; @@ -258,36 +297,36 @@ public partial class PrivateCloudProperties : public string ProvisioningNetwork { get => this._provisioningNetwork; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit _secondaryCircuit; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit _secondaryCircuit; /// /// A secondary expressRoute circuit from a separate AZ. Only present in a stretched private cloud /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit SecondaryCircuit { get => (this._secondaryCircuit = this._secondaryCircuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit()); set => this._secondaryCircuit = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit SecondaryCircuit { get => (this._secondaryCircuit = this._secondaryCircuit ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit()); set => this._secondaryCircuit = value; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).ExpressRouteId; } + public string SecondaryCircuitExpressRouteId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).ExpressRouteId; } /// ExpressRoute Circuit private peering identifier [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).ExpressRoutePrivatePeeringId; } + public string SecondaryCircuitExpressRoutePrivatePeeringId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).ExpressRoutePrivatePeeringId; } /// CIDR of primary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).PrimarySubnet; } + public string SecondaryCircuitPrimarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).PrimarySubnet; } /// CIDR of secondary subnet [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuitInternal)SecondaryCircuit).SecondarySubnet; } + public string SecondaryCircuitSecondarySubnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuitInternal)SecondaryCircuit).SecondarySubnet; } /// Backing field for property. private string _vcenterCertificateThumbprint; @@ -331,12 +370,15 @@ public PrivateCloudProperties() /// The properties of a private cloud resource public partial interface IPrivateCloudProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties { /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the ExpressRoute Circuit (Microsoft Colo only)", SerializedName = @"expressRouteID", PossibleTypes = new [] { typeof(string) })] @@ -345,6 +387,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ExpressRoute Circuit private peering identifier", SerializedName = @"expressRoutePrivatePeeringID", PossibleTypes = new [] { typeof(string) })] @@ -353,6 +398,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of primary subnet", SerializedName = @"primarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -361,6 +409,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of secondary subnet", SerializedName = @"secondarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -369,6 +420,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for the HCX Cloud Manager", SerializedName = @"hcxCloudManager", PossibleTypes = new [] { typeof(string) })] @@ -377,6 +431,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for the NSX-T Data Center manager", SerializedName = @"nsxtManager", PossibleTypes = new [] { typeof(string) })] @@ -385,6 +442,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Endpoint for Virtual Center Server Appliance", SerializedName = @"vcsa", PossibleTypes = new [] { typeof(string) })] @@ -393,14 +453,20 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Array of cloud link IDs from other clouds that connect to this one", SerializedName = @"externalCloudLinks", PossibleTypes = new [] { typeof(string) })] - string[] ExternalCloudLink { get; } + System.Collections.Generic.List ExternalCloudLink { get; } /// Network used to access vCenter Server and NSX-T Manager [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Network used to access vCenter Server and NSX-T Manager", SerializedName = @"managementNetwork", PossibleTypes = new [] { typeof(string) })] @@ -412,14 +478,34 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The block of addresses should be unique across VNet in your subscription as well as on-premise. Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22", SerializedName = @"networkBlock", PossibleTypes = new [] { typeof(string) })] string NetworkBlock { get; set; } + /// + /// Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024 + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024", + SerializedName = @"nsxPublicIpQuotaRaised", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string NsxPublicIPQuotaRaised { get; } /// Thumbprint of the NSX-T Manager SSL certificate [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Thumbprint of the NSX-T Manager SSL certificate", SerializedName = @"nsxtCertificateThumbprint", PossibleTypes = new [] { typeof(string) })] @@ -428,6 +514,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optionally, set the NSX-T Manager password when the private cloud is created", SerializedName = @"nsxtPassword", PossibleTypes = new [] { typeof(string) })] @@ -436,6 +525,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Used for virtual machine cold migration, cloning, and snapshot migration", SerializedName = @"provisioningNetwork", PossibleTypes = new [] { typeof(string) })] @@ -444,14 +536,21 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Identifier of the ExpressRoute Circuit (Microsoft Colo only)", SerializedName = @"expressRouteID", PossibleTypes = new [] { typeof(string) })] @@ -460,6 +559,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"ExpressRoute Circuit private peering identifier", SerializedName = @"expressRoutePrivatePeeringID", PossibleTypes = new [] { typeof(string) })] @@ -468,6 +570,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of primary subnet", SerializedName = @"primarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -476,6 +581,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR of secondary subnet", SerializedName = @"secondarySubnet", PossibleTypes = new [] { typeof(string) })] @@ -484,6 +592,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Thumbprint of the vCenter Server SSL certificate", SerializedName = @"vcenterCertificateThumbprint", PossibleTypes = new [] { typeof(string) })] @@ -492,6 +603,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Optionally, set the vCenter admin password when the private cloud is created", SerializedName = @"vcenterPassword", PossibleTypes = new [] { typeof(string) })] @@ -500,6 +614,9 @@ public partial interface IPrivateCloudProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Used for live migration of virtual machines", SerializedName = @"vmotionNetwork", PossibleTypes = new [] { typeof(string) })] @@ -508,10 +625,10 @@ public partial interface IPrivateCloudProperties : } /// The properties of a private cloud resource internal partial interface IPrivateCloudPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdatePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal { /// An ExpressRoute Circuit - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit Circuit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit Circuit { get; set; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) string CircuitExpressRouteId { get; set; } /// ExpressRoute Circuit private peering identifier @@ -521,7 +638,7 @@ internal partial interface IPrivateCloudPropertiesInternal : /// CIDR of secondary subnet string CircuitSecondarySubnet { get; set; } /// The endpoints - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IEndpoints Endpoint { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEndpoints Endpoint { get; set; } /// Endpoint for the HCX Cloud Manager string EndpointHcxCloudManager { get; set; } /// Endpoint for the NSX-T Data Center manager @@ -529,7 +646,7 @@ internal partial interface IPrivateCloudPropertiesInternal : /// Endpoint for Virtual Center Server Appliance string EndpointVcsa { get; set; } /// Array of cloud link IDs from other clouds that connect to this one - string[] ExternalCloudLink { get; set; } + System.Collections.Generic.List ExternalCloudLink { get; set; } /// Network used to access vCenter Server and NSX-T Manager string ManagementNetwork { get; set; } /// @@ -537,6 +654,11 @@ internal partial interface IPrivateCloudPropertiesInternal : /// is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22 /// string NetworkBlock { get; set; } + /// + /// Flag to indicate whether the private cloud has the quota for provisioned NSX Public IP count raised from 64 to 1024 + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string NsxPublicIPQuotaRaised { get; set; } /// Thumbprint of the NSX-T Manager SSL certificate string NsxtCertificateThumbprint { get; set; } /// Optionally, set the NSX-T Manager password when the private cloud is created @@ -544,11 +666,12 @@ internal partial interface IPrivateCloudPropertiesInternal : /// Used for virtual machine cold migration, cloning, and snapshot migration string ProvisioningNetwork { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Pending", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// /// A secondary expressRoute circuit from a separate AZ. Only present in a stretched private cloud /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICircuit SecondaryCircuit { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICircuit SecondaryCircuit { get; set; } /// Identifier of the ExpressRoute Circuit (Microsoft Colo only) string SecondaryCircuitExpressRouteId { get; set; } /// ExpressRoute Circuit private peering identifier diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.json.cs similarity index 81% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.json.cs index 267a2102c4c2..68ea9f7b1fe2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateCloudProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PrivateCloudProperties(json) : null; } @@ -77,20 +77,21 @@ internal PrivateCloudProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - __privateCloudUpdateProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties(json); - {_circuit = If( json?.PropertyT("circuit"), out var __jsonCircuit) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit.FromJson(__jsonCircuit) : Circuit;} - {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Endpoints.FromJson(__jsonEndpoints) : Endpoint;} - {_secondaryCircuit = If( json?.PropertyT("secondaryCircuit"), out var __jsonSecondaryCircuit) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Circuit.FromJson(__jsonSecondaryCircuit) : SecondaryCircuit;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_networkBlock = If( json?.PropertyT("networkBlock"), out var __jsonNetworkBlock) ? (string)__jsonNetworkBlock : (string)NetworkBlock;} - {_managementNetwork = If( json?.PropertyT("managementNetwork"), out var __jsonManagementNetwork) ? (string)__jsonManagementNetwork : (string)ManagementNetwork;} - {_provisioningNetwork = If( json?.PropertyT("provisioningNetwork"), out var __jsonProvisioningNetwork) ? (string)__jsonProvisioningNetwork : (string)ProvisioningNetwork;} - {_vmotionNetwork = If( json?.PropertyT("vmotionNetwork"), out var __jsonVmotionNetwork) ? (string)__jsonVmotionNetwork : (string)VmotionNetwork;} - {_vcenterPassword = If( json?.PropertyT("vcenterPassword"), out var __jsonVcenterPassword) ? (string)__jsonVcenterPassword : (string)VcenterPassword;} - {_nsxtPassword = If( json?.PropertyT("nsxtPassword"), out var __jsonNsxtPassword) ? (string)__jsonNsxtPassword : (string)NsxtPassword;} - {_vcenterCertificateThumbprint = If( json?.PropertyT("vcenterCertificateThumbprint"), out var __jsonVcenterCertificateThumbprint) ? (string)__jsonVcenterCertificateThumbprint : (string)VcenterCertificateThumbprint;} - {_nsxtCertificateThumbprint = If( json?.PropertyT("nsxtCertificateThumbprint"), out var __jsonNsxtCertificateThumbprint) ? (string)__jsonNsxtCertificateThumbprint : (string)NsxtCertificateThumbprint;} - {_externalCloudLink = If( json?.PropertyT("externalCloudLinks"), out var __jsonExternalCloudLinks) ? If( __jsonExternalCloudLinks as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ExternalCloudLink;} + __privateCloudUpdateProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties(json); + {_circuit = If( json?.PropertyT("circuit"), out var __jsonCircuit) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit.FromJson(__jsonCircuit) : _circuit;} + {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Endpoints.FromJson(__jsonEndpoints) : _endpoint;} + {_secondaryCircuit = If( json?.PropertyT("secondaryCircuit"), out var __jsonSecondaryCircuit) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Circuit.FromJson(__jsonSecondaryCircuit) : _secondaryCircuit;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_networkBlock = If( json?.PropertyT("networkBlock"), out var __jsonNetworkBlock) ? (string)__jsonNetworkBlock : (string)_networkBlock;} + {_managementNetwork = If( json?.PropertyT("managementNetwork"), out var __jsonManagementNetwork) ? (string)__jsonManagementNetwork : (string)_managementNetwork;} + {_provisioningNetwork = If( json?.PropertyT("provisioningNetwork"), out var __jsonProvisioningNetwork) ? (string)__jsonProvisioningNetwork : (string)_provisioningNetwork;} + {_vmotionNetwork = If( json?.PropertyT("vmotionNetwork"), out var __jsonVmotionNetwork) ? (string)__jsonVmotionNetwork : (string)_vmotionNetwork;} + {_vcenterPassword = If( json?.PropertyT("vcenterPassword"), out var __jsonVcenterPassword) ? (string)__jsonVcenterPassword : (string)_vcenterPassword;} + {_nsxtPassword = If( json?.PropertyT("nsxtPassword"), out var __jsonNsxtPassword) ? (string)__jsonNsxtPassword : (string)_nsxtPassword;} + {_vcenterCertificateThumbprint = If( json?.PropertyT("vcenterCertificateThumbprint"), out var __jsonVcenterCertificateThumbprint) ? (string)__jsonVcenterCertificateThumbprint : (string)_vcenterCertificateThumbprint;} + {_nsxtCertificateThumbprint = If( json?.PropertyT("nsxtCertificateThumbprint"), out var __jsonNsxtCertificateThumbprint) ? (string)__jsonNsxtCertificateThumbprint : (string)_nsxtCertificateThumbprint;} + {_externalCloudLink = If( json?.PropertyT("externalCloudLinks"), out var __jsonExternalCloudLinks) ? If( __jsonExternalCloudLinks as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _externalCloudLink;} + {_nsxPublicIPQuotaRaised = If( json?.PropertyT("nsxPublicIpQuotaRaised"), out var __jsonNsxPublicIPQuotaRaised) ? (string)__jsonNsxPublicIPQuotaRaised : (string)_nsxPublicIPQuotaRaised;} AfterFromJson(json); } @@ -115,39 +116,42 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } __privateCloudUpdateProperties?.ToJson(container, serializationMode); AddIf( null != this._circuit ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._circuit.ToJson(null,serializationMode) : null, "circuit" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._endpoint ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._endpoint.ToJson(null,serializationMode) : null, "endpoints" ,container.Add ); } AddIf( null != this._secondaryCircuit ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._secondaryCircuit.ToJson(null,serializationMode) : null, "secondaryCircuit" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - AddIf( null != (((object)this._networkBlock)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._networkBlock.ToString()) : null, "networkBlock" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._networkBlock)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._networkBlock.ToString()) : null, "networkBlock" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._managementNetwork)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._managementNetwork.ToString()) : null, "managementNetwork" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningNetwork)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningNetwork.ToString()) : null, "provisioningNetwork" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vmotionNetwork)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vmotionNetwork.ToString()) : null, "vmotionNetwork" ,container.Add ); } AddIf( null != (((object)this._vcenterPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vcenterPassword.ToString()) : null, "vcenterPassword" ,container.Add ); AddIf( null != (((object)this._nsxtPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nsxtPassword.ToString()) : null, "nsxtPassword" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vcenterCertificateThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vcenterCertificateThumbprint.ToString()) : null, "vcenterCertificateThumbprint" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nsxtCertificateThumbprint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nsxtCertificateThumbprint.ToString()) : null, "nsxtCertificateThumbprint" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._externalCloudLink) { @@ -159,6 +163,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("externalCloudLinks",__w); } } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._nsxPublicIPQuotaRaised)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nsxPublicIPQuotaRaised.ToString()) : null, "nsxPublicIpQuotaRaised" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.PowerShell.cs new file mode 100644 index 000000000000..bd1aa9ec47d0 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.PowerShell.cs @@ -0,0 +1,372 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// An update to a private cloud resource + [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdateTypeConverter))] + public partial class PrivateCloudUpdate + { + + /// + /// 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.VMware.Models.IPrivateCloudUpdate DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateCloudUpdate(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.VMware.Models.IPrivateCloudUpdate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateCloudUpdate(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.VMware.Models.IPrivateCloudUpdate FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateCloudUpdate(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.VMware.Models.IPrivateCloudUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdatePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType, 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 PrivateCloudUpdate(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.VMware.Models.IPrivateCloudUpdateInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdatePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal)this).KeyVaultPropertyVersionType, 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.VMware.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(); + } + } + /// An update to a private cloud resource + [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdateTypeConverter))] + public partial interface IPrivateCloudUpdate + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.TypeConverter.cs index 83a4536d8f2a..e5030ca19343 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudUpdate ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.cs new file mode 100644 index 000000000000..e0d053ce698f --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.cs @@ -0,0 +1,506 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// An update to a private cloud resource + public partial class PrivateCloudUpdate : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal + { + + /// The secondary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilitySecondaryZone = value ?? default(int); } + + /// The availability strategy for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityStrategy = value ?? null; } + + /// The primary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).AvailabilityZone = value ?? default(int); } + + /// Status of customer managed encryption key + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionStatus = value ?? null; } + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ExtendedNetworkBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ExtendedNetworkBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ExtendedNetworkBlock = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity _identity; + + /// The identity of the private cloud, if configured. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity()); set => this._identity = value; } + + /// + /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).PrincipalId; } + + /// vCenter Single Sign On Identity Sources + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List IdentitySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).IdentitySource = value ?? null /* arrayOf */; } + + /// + /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).TenantId; } + + /// + /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The + /// type 'None' will remove any identities from the Private Cloud. + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).Type = value ?? null; } + + /// Connectivity to internet is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string Internet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Internet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Internet = value ?? null; } + + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyAutoDetectedKeyVersion; } + + /// The name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyName = value ?? null; } + + /// The state of key provided + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; } + + /// The URL of the vault. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVaultUrl = value ?? null; } + + /// The version of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyVersion = value ?? null; } + + /// Property of the key if user provided or auto detected + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; } + + /// The hosts + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterHost = value ?? null /* arrayOf */; } + + /// The identity + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; } + + /// The state of the cluster provisioning + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; } + + /// The cluster size + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterSize = value ?? default(int); } + + /// Internal Acessors for Availability + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.Availability { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Availability; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Availability = value; } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).Encryption = value; } + + /// Internal Acessors for EncryptionKeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).EncryptionKeyVaultProperty = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for KeyVaultPropertyAutoDetectedKeyVersion + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyAutoDetectedKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyAutoDetectedKeyVersion = value; } + + /// Internal Acessors for KeyVaultPropertyKeyState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyKeyState = value; } + + /// Internal Acessors for KeyVaultPropertyVersionType + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).KeyVaultPropertyVersionType = value; } + + /// Internal Acessors for ManagementCluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.ManagementCluster { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementCluster = value; } + + /// Internal Acessors for ManagementClusterId + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterId = value; } + + /// Internal Acessors for ManagementClusterProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)Property).ManagementClusterProvisioningState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties _property; + + /// The updatable properties of a private cloud resource + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags _tag; + + /// Resource tags + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags()); set => this._tag = value; } + + /// Creates an new instance. + public PrivateCloudUpdate() + { + + } + } + /// An update to a private cloud resource + public partial interface IPrivateCloudUpdate : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// The secondary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The secondary availability zone for the private cloud", + SerializedName = @"secondaryZone", + PossibleTypes = new [] { typeof(int) })] + int? AvailabilitySecondaryZone { get; set; } + /// The availability strategy for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The availability strategy for the private cloud", + SerializedName = @"strategy", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string AvailabilityStrategy { get; set; } + /// The primary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The primary availability zone for the private cloud", + SerializedName = @"zone", + PossibleTypes = new [] { typeof(int) })] + int? AvailabilityZone { get; set; } + /// Status of customer managed encryption key + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Status of customer managed encryption key", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string EncryptionStatus { get; set; } + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).", + SerializedName = @"extendedNetworkBlocks", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ExtendedNetworkBlock { get; set; } + /// + /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The principal ID of private cloud identity. This property will only be provided for a system assigned identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// vCenter Single Sign On Identity Sources + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"vCenter Single Sign On Identity Sources", + SerializedName = @"identitySources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource) })] + System.Collections.Generic.List IdentitySource { get; set; } + /// + /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// + /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The + /// type 'None' will remove any identities from the Private Cloud. + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string IdentityType { get; set; } + /// Connectivity to internet is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Connectivity to internet is enabled or disabled", + SerializedName = @"internet", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Internet { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The auto-detected version of the key if versionType is auto-detected.", + SerializedName = @"autoDetectedKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyAutoDetectedKeyVersion { get; } + /// The name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the key.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyName { get; set; } + /// The state of key provided + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The state of key provided", + SerializedName = @"keyState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; } + /// The URL of the vault. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the vault.", + SerializedName = @"keyVaultUrl", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVaultUrl { get; set; } + /// The version of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The version of the key.", + SerializedName = @"keyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVersion { get; set; } + /// Property of the key if user provided or auto detected + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Property of the key if user provided or auto detected", + SerializedName = @"versionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; } + /// The hosts + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The hosts", + SerializedName = @"hosts", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ManagementClusterHost { get; set; } + /// The identity + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The identity", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(int) })] + int? ManagementClusterId { get; } + /// The state of the cluster provisioning + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The state of the cluster provisioning", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ManagementClusterProvisioningState { get; } + /// The cluster size + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The cluster size", + SerializedName = @"clusterSize", + PossibleTypes = new [] { typeof(int) })] + int? ManagementClusterSize { get; set; } + /// Resource tags + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Resource tags", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get; set; } + + } + /// An update to a private cloud resource + internal partial interface IPrivateCloudUpdateInternal + + { + /// Properties describing how the cloud is distributed across availability zones + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Availability { get; set; } + /// The secondary availability zone for the private cloud + int? AvailabilitySecondaryZone { get; set; } + /// The availability strategy for the private cloud + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string AvailabilityStrategy { get; set; } + /// The primary availability zone for the private cloud + int? AvailabilityZone { get; set; } + /// Customer managed key encryption, can be enabled or disabled + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Encryption { get; set; } + /// The key vault where the encryption key is stored + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get; set; } + /// Status of customer managed encryption key + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string EncryptionStatus { get; set; } + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + System.Collections.Generic.List ExtendedNetworkBlock { get; set; } + /// The identity of the private cloud, if configured. + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudIdentity Identity { get; set; } + /// + /// The principal ID of private cloud identity. This property will only be provided for a system assigned identity. + /// + string IdentityPrincipalId { get; set; } + /// vCenter Single Sign On Identity Sources + System.Collections.Generic.List IdentitySource { get; set; } + /// + /// The tenant ID associated with the private cloud. This property will only be provided for a system assigned identity. + /// + string IdentityTenantId { get; set; } + /// + /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The + /// type 'None' will remove any identities from the Private Cloud. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + string IdentityType { get; set; } + /// Connectivity to internet is enabled or disabled + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Internet { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + string KeyVaultPropertyAutoDetectedKeyVersion { get; set; } + /// The name of the key. + string KeyVaultPropertyKeyName { get; set; } + /// The state of key provided + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; set; } + /// The URL of the vault. + string KeyVaultPropertyKeyVaultUrl { get; set; } + /// The version of the key. + string KeyVaultPropertyKeyVersion { get; set; } + /// Property of the key if user provided or auto detected + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; set; } + /// The default cluster used for management + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster ManagementCluster { get; set; } + /// The hosts + System.Collections.Generic.List ManagementClusterHost { get; set; } + /// The identity + int? ManagementClusterId { get; set; } + /// The state of the cluster provisioning + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ManagementClusterProvisioningState { get; set; } + /// The cluster size + int? ManagementClusterSize { get; set; } + /// The updatable properties of a private cloud resource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties Property { get; set; } + /// Resource tags + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.json.cs index d0238b7aec9f..9659ff98c73e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdate.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdate.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateCloudUpdate partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PrivateCloudUpdate(json) : null; } @@ -77,9 +77,9 @@ internal PrivateCloudUpdate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Js { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdateProperties.FromJson(__jsonProperties) : Property;} - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudIdentity.FromJson(__jsonIdentity) : Identity;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdateProperties.FromJson(__jsonProperties) : _property;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudIdentity.FromJson(__jsonIdentity) : _identity;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.PowerShell.cs new file mode 100644 index 000000000000..b1a23b758e77 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.PowerShell.cs @@ -0,0 +1,324 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// The properties of a private cloud resource that may be updated + [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdatePropertiesTypeConverter))] + public partial class PrivateCloudUpdateProperties + { + + /// + /// 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.VMware.Models.IPrivateCloudUpdateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateCloudUpdateProperties(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.VMware.Models.IPrivateCloudUpdateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateCloudUpdateProperties(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.VMware.Models.IPrivateCloudUpdateProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateCloudUpdateProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, 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 PrivateCloudUpdateProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagementCluster")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster) content.GetValueForProperty("ManagementCluster",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementCluster, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementClusterTypeConverter.ConvertFrom); + } + if (content.Contains("Availability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties) content.GetValueForProperty("Availability",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Availability, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("Internet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet = (string) content.GetValueForProperty("Internet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).Internet, global::System.Convert.ToString); + } + if (content.Contains("IdentitySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource = (System.Collections.Generic.List) content.GetValueForProperty("IdentitySource",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).IdentitySource, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySourceTypeConverter.ConvertFrom)); + } + if (content.Contains("ExtendedNetworkBlock")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock = (System.Collections.Generic.List) content.GetValueForProperty("ExtendedNetworkBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ExtendedNetworkBlock, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy = (string) content.GetValueForProperty("AvailabilityStrategy",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityStrategy, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize = (int?) content.GetValueForProperty("ManagementClusterSize",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterSize, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState = (string) content.GetValueForProperty("ManagementClusterProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ManagementClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId = (int?) content.GetValueForProperty("ManagementClusterId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterId, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ManagementClusterHost")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost = (System.Collections.Generic.List) content.GetValueForProperty("ManagementClusterHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).ManagementClusterHost, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone = (int?) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilityZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AvailabilitySecondaryZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone = (int?) content.GetValueForProperty("AvailabilitySecondaryZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).AvailabilitySecondaryZone, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EncryptionKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties) content.GetValueForProperty("EncryptionKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.EncryptionKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus = (string) content.GetValueForProperty("EncryptionStatus",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).EncryptionStatus, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyAutoDetectedKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyAutoDetectedKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyAutoDetectedKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUrl",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyVaultUrl, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState = (string) content.GetValueForProperty("KeyVaultPropertyKeyState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyKeyState, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyVersionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType = (string) content.GetValueForProperty("KeyVaultPropertyVersionType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal)this).KeyVaultPropertyVersionType, 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.VMware.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(); + } + } + /// The properties of a private cloud resource that may be updated + [System.ComponentModel.TypeConverter(typeof(PrivateCloudUpdatePropertiesTypeConverter))] + public partial interface IPrivateCloudUpdateProperties + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.TypeConverter.cs index 60652f599738..9eff79dde8b1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudUpdateProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.cs new file mode 100644 index 000000000000..dd4a0dea2baf --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.cs @@ -0,0 +1,412 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// The properties of a private cloud resource that may be updated + public partial class PrivateCloudUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties _availability; + + /// Properties describing how the cloud is distributed across availability zones + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Availability { get => (this._availability = this._availability ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityProperties()); set => this._availability = value; } + + /// The secondary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? AvailabilitySecondaryZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)Availability).SecondaryZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)Availability).SecondaryZone = value ?? default(int); } + + /// The availability strategy for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string AvailabilityStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)Availability).Strategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)Availability).Strategy = value ?? null; } + + /// The primary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)Availability).Zone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityPropertiesInternal)Availability).Zone = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption _encryption; + + /// Customer managed key encryption, can be enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Encryption()); set => this._encryption = value; } + + /// Status of customer managed encryption key + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string EncryptionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).Status = value ?? null; } + + /// Backing field for property. + private System.Collections.Generic.List _extendedNetworkBlock; + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List ExtendedNetworkBlock { get => this._extendedNetworkBlock; set => this._extendedNetworkBlock = value; } + + /// Backing field for property. + private System.Collections.Generic.List _identitySource; + + /// vCenter Single Sign On Identity Sources + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List IdentitySource { get => this._identitySource; set => this._identitySource = value; } + + /// Backing field for property. + private string _internet; + + /// Connectivity to internet is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string Internet { get => this._internet; set => this._internet = value; } + + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyAutoDetectedKeyVersion; } + + /// The name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyName = value ?? null; } + + /// The state of key provided + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyState; } + + /// The URL of the vault. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVaultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVaultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVaultUrl = value ?? null; } + + /// The version of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyVersion = value ?? null; } + + /// Property of the key if user provided or auto detected + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyVersionType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster _managementCluster; + + /// The default cluster used for management + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster ManagementCluster { get => (this._managementCluster = this._managementCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementCluster()); set => this._managementCluster = value; } + + /// The hosts + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ManagementClusterHost { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).Host; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).Host = value ?? null /* arrayOf */; } + + /// The identity + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ClusterId; } + + /// The state of the cluster provisioning + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ProvisioningState; } + + /// The cluster size + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public int? ManagementClusterSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ClusterSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ClusterSize = value ?? default(int); } + + /// Internal Acessors for Availability + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.Availability { get => (this._availability = this._availability ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityProperties()); set { {_availability = value;} } } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Encryption()); set { {_encryption = value;} } } + + /// Internal Acessors for EncryptionKeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.EncryptionKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultProperty = value; } + + /// Internal Acessors for KeyVaultPropertyAutoDetectedKeyVersion + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyAutoDetectedKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyAutoDetectedKeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyAutoDetectedKeyVersion = value; } + + /// Internal Acessors for KeyVaultPropertyKeyState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyKeyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyKeyState = value; } + + /// Internal Acessors for KeyVaultPropertyVersionType + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.KeyVaultPropertyVersionType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyVersionType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionInternal)Encryption).KeyVaultPropertyVersionType = value; } + + /// Internal Acessors for ManagementCluster + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.ManagementCluster { get => (this._managementCluster = this._managementCluster ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementCluster()); set { {_managementCluster = value;} } } + + /// Internal Acessors for ManagementClusterId + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.ManagementClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ClusterId = value; } + + /// Internal Acessors for ManagementClusterProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdatePropertiesInternal.ManagementClusterProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICommonClusterPropertiesInternal)ManagementCluster).ProvisioningState = value; } + + /// Creates an new instance. + public PrivateCloudUpdateProperties() + { + + } + } + /// The properties of a private cloud resource that may be updated + public partial interface IPrivateCloudUpdateProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// The secondary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The secondary availability zone for the private cloud", + SerializedName = @"secondaryZone", + PossibleTypes = new [] { typeof(int) })] + int? AvailabilitySecondaryZone { get; set; } + /// The availability strategy for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The availability strategy for the private cloud", + SerializedName = @"strategy", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string AvailabilityStrategy { get; set; } + /// The primary availability zone for the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The primary availability zone for the private cloud", + SerializedName = @"zone", + PossibleTypes = new [] { typeof(int) })] + int? AvailabilityZone { get; set; } + /// Status of customer managed encryption key + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Status of customer managed encryption key", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string EncryptionStatus { get; set; } + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).", + SerializedName = @"extendedNetworkBlocks", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ExtendedNetworkBlock { get; set; } + /// vCenter Single Sign On Identity Sources + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"vCenter Single Sign On Identity Sources", + SerializedName = @"identitySources", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource) })] + System.Collections.Generic.List IdentitySource { get; set; } + /// Connectivity to internet is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Connectivity to internet is enabled or disabled", + SerializedName = @"internet", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Internet { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The auto-detected version of the key if versionType is auto-detected.", + SerializedName = @"autoDetectedKeyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyAutoDetectedKeyVersion { get; } + /// The name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the key.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyName { get; set; } + /// The state of key provided + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The state of key provided", + SerializedName = @"keyState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; } + /// The URL of the vault. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the vault.", + SerializedName = @"keyVaultUrl", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVaultUrl { get; set; } + /// The version of the key. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The version of the key.", + SerializedName = @"keyVersion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVersion { get; set; } + /// Property of the key if user provided or auto detected + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Property of the key if user provided or auto detected", + SerializedName = @"versionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; } + /// The hosts + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The hosts", + SerializedName = @"hosts", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ManagementClusterHost { get; set; } + /// The identity + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The identity", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(int) })] + int? ManagementClusterId { get; } + /// The state of the cluster provisioning + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The state of the cluster provisioning", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ManagementClusterProvisioningState { get; } + /// The cluster size + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The cluster size", + SerializedName = @"clusterSize", + PossibleTypes = new [] { typeof(int) })] + int? ManagementClusterSize { get; set; } + + } + /// The properties of a private cloud resource that may be updated + internal partial interface IPrivateCloudUpdatePropertiesInternal + + { + /// Properties describing how the cloud is distributed across availability zones + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAvailabilityProperties Availability { get; set; } + /// The secondary availability zone for the private cloud + int? AvailabilitySecondaryZone { get; set; } + /// The availability strategy for the private cloud + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + string AvailabilityStrategy { get; set; } + /// The primary availability zone for the private cloud + int? AvailabilityZone { get; set; } + /// Customer managed key encryption, can be enabled or disabled + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryption Encryption { get; set; } + /// The key vault where the encryption key is stored + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IEncryptionKeyVaultProperties EncryptionKeyVaultProperty { get; set; } + /// Status of customer managed encryption key + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string EncryptionStatus { get; set; } + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + System.Collections.Generic.List ExtendedNetworkBlock { get; set; } + /// vCenter Single Sign On Identity Sources + System.Collections.Generic.List IdentitySource { get; set; } + /// Connectivity to internet is enabled or disabled + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Internet { get; set; } + /// The auto-detected version of the key if versionType is auto-detected. + string KeyVaultPropertyAutoDetectedKeyVersion { get; set; } + /// The name of the key. + string KeyVaultPropertyKeyName { get; set; } + /// The state of key provided + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Connected", "AccessDenied")] + string KeyVaultPropertyKeyState { get; set; } + /// The URL of the vault. + string KeyVaultPropertyKeyVaultUrl { get; set; } + /// The version of the key. + string KeyVaultPropertyKeyVersion { get; set; } + /// Property of the key if user provided or auto detected + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Fixed", "AutoDetected")] + string KeyVaultPropertyVersionType { get; set; } + /// The default cluster used for management + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IManagementCluster ManagementCluster { get; set; } + /// The hosts + System.Collections.Generic.List ManagementClusterHost { get; set; } + /// The identity + int? ManagementClusterId { get; set; } + /// The state of the cluster provisioning + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Cancelled", "Deleting", "Updating", "Canceled")] + string ManagementClusterProvisioningState { get; set; } + /// The cluster size + int? ManagementClusterSize { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.json.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.json.cs index 82433d35cf4d..3c32d20c5ef7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PrivateCloudUpdateProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PrivateCloudUpdateProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PrivateCloudUpdateProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdateProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PrivateCloudUpdateProperties(json) : null; } @@ -77,11 +77,12 @@ internal PrivateCloudUpdateProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware. { return; } - {_managementCluster = If( json?.PropertyT("managementCluster"), out var __jsonManagementCluster) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CommonClusterProperties.FromJson(__jsonManagementCluster) : ManagementCluster;} - {_availability = If( json?.PropertyT("availability"), out var __jsonAvailability) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AvailabilityProperties.FromJson(__jsonAvailability) : Availability;} - {_encryption = If( json?.PropertyT("encryption"), out var __jsonEncryption) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Encryption.FromJson(__jsonEncryption) : Encryption;} - {_internet = If( json?.PropertyT("internet"), out var __jsonInternet) ? (string)__jsonInternet : (string)Internet;} - {_identitySource = If( json?.PropertyT("identitySources"), out var __jsonIdentitySources) ? If( __jsonIdentitySources as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IIdentitySource) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IdentitySource.FromJson(__u) )) ))() : null : IdentitySource;} + {_managementCluster = If( json?.PropertyT("managementCluster"), out var __jsonManagementCluster) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ManagementCluster.FromJson(__jsonManagementCluster) : _managementCluster;} + {_availability = If( json?.PropertyT("availability"), out var __jsonAvailability) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AvailabilityProperties.FromJson(__jsonAvailability) : _availability;} + {_encryption = If( json?.PropertyT("encryption"), out var __jsonEncryption) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Encryption.FromJson(__jsonEncryption) : _encryption;} + {_internet = If( json?.PropertyT("internet"), out var __jsonInternet) ? (string)__jsonInternet : (string)_internet;} + {_identitySource = If( json?.PropertyT("identitySources"), out var __jsonIdentitySources) ? If( __jsonIdentitySources as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.IIdentitySource) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource.FromJson(__u) )) ))() : null : _identitySource;} + {_extendedNetworkBlock = If( json?.PropertyT("extendedNetworkBlocks"), out var __jsonExtendedNetworkBlocks) ? If( __jsonExtendedNetworkBlocks as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _extendedNetworkBlock;} AfterFromJson(json); } @@ -105,7 +106,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } AddIf( null != this._managementCluster ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._managementCluster.ToJson(null,serializationMode) : null, "managementCluster" ,container.Add ); - AddIf( null != this._availability ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._availability.ToJson(null,serializationMode) : null, "availability" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._availability ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._availability.ToJson(null,serializationMode) : null, "availability" ,container.Add ); + } AddIf( null != this._encryption ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._encryption.ToJson(null,serializationMode) : null, "encryption" ,container.Add ); AddIf( null != (((object)this._internet)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._internet.ToString()) : null, "internet" ,container.Add ); if (null != this._identitySource) @@ -117,6 +121,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } container.Add("identitySources",__w); } + if (null != this._extendedNetworkBlock) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(); + foreach( var __s in this._extendedNetworkBlock ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("extendedNetworkBlocks",__r); + } AfterToJson(ref container); return container; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.PowerShell.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.PowerShell.cs index bd6f1c22475a..8d212c49b8eb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ProxyResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ProxyResource(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.VMware.Models.Api20211201.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ProxyResource(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProx /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,21 +111,21 @@ internal ProxyResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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. @@ -140,15 +140,15 @@ internal ProxyResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.TypeConverter.cs index e17709eb8b2c..eb2e6c587ac0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IProxyResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.cs b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.cs index 2dd1d825c207..9755a15ade77 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.cs @@ -3,42 +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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The resource model definition for a ARM proxy resource public partial class ProxyResource : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResource, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public ProxyResource() @@ -61,13 +60,13 @@ public ProxyResource() /// The resource model definition for a ARM proxy resource public partial interface IProxyResource : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { } /// The resource model definition for a ARM proxy resource internal partial interface IProxyResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.json.cs index 7eaf20c86f47..22f97c3f031a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ProxyResource.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ProxyResource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class ProxyResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; } @@ -77,7 +75,7 @@ internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.PowerShell.cs similarity index 72% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.PowerShell.cs index 47c59d403cfd..55b2e3b78bd1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class PsCredentialExecutionParameter partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IPsCredentialExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PsCredentialExecutionParameter(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.VMware.Models.Api20211201.IPsCredentialExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PsCredentialExecutionParameter(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCr /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -113,25 +111,25 @@ internal PsCredentialExecutionParameter(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Username, global::System.Convert.ToString); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Password, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, 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. @@ -146,19 +144,19 @@ internal PsCredentialExecutionParameter(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Username, global::System.Convert.ToString); } if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal)this).Password, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal)this).Password, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.TypeConverter.cs index 084a2934cf3a..d24af0411eac 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.cs b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.cs index f31ccbdb9466..49e8e920410a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.cs @@ -3,25 +3,25 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// a powershell credential object public partial class PsCredentialExecutionParameter : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameterInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameterInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter(); /// The parameter name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name = value ; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name = value ; } /// Backing field for property. private string _password; @@ -31,8 +31,9 @@ public partial class PsCredentialExecutionParameter : public string Password { get => this._password; set => this._password = value; } /// The type of execution parameter + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type = value ; } + public string Type { get => "Credential"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type = "Credential"; } /// Backing field for property. private string _username; @@ -44,7 +45,7 @@ public partial class PsCredentialExecutionParameter : /// Creates an new instance. public PsCredentialExecutionParameter() { - + this.__scriptExecutionParameter.Type = "Credential"; } /// Validates that this object meets the validation criteria. @@ -62,12 +63,15 @@ public PsCredentialExecutionParameter() /// a powershell credential object public partial interface IPsCredentialExecutionParameter : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter { /// password for login [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"password for login", SerializedName = @"password", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +80,9 @@ public partial interface IPsCredentialExecutionParameter : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"username for login", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] @@ -84,7 +91,7 @@ public partial interface IPsCredentialExecutionParameter : } /// a powershell credential object internal partial interface IPsCredentialExecutionParameterInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal { /// password for login string Password { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.json.cs index 5a45f0173e36..5b0d5b8d0815 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/PsCredentialExecutionParameter.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/PsCredentialExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PsCredentialExecutionParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPsCredentialExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPsCredentialExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new PsCredentialExecutionParameter(json) : null; } @@ -77,9 +77,9 @@ internal PsCredentialExecutionParameter(Microsoft.Azure.PowerShell.Cmdlets.VMwar { return; } - __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter(json); - {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} + __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter(json); + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)_username;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)_password;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Quota.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Quota.PowerShell.cs index 8368646b8400..23386881dce4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Quota.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Quota partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IQuota DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Quota(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.VMware.Models.Api20211201.IQuota DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Quota(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuot /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal Quota(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("HostsRemaining")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).HostsRemaining = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining) content.GetValueForProperty("HostsRemaining",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).HostsRemaining, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemainingTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).HostsRemaining = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining) content.GetValueForProperty("HostsRemaining",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).HostsRemaining, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemainingTypeConverter.ConvertFrom); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).Enabled, 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,11 +136,11 @@ internal Quota(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("HostsRemaining")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).HostsRemaining = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining) content.GetValueForProperty("HostsRemaining",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).HostsRemaining, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemainingTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).HostsRemaining = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining) content.GetValueForProperty("HostsRemaining",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).HostsRemaining, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemainingTypeConverter.ConvertFrom); } if (content.Contains("Enabled")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal)this).Enabled, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Quota.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Quota.TypeConverter.cs index 707150449ce7..21dbeb933cc8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Quota.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IQuota ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.cs b/src/VMware/VMware.Autorest/generated/api/Models/Quota.cs similarity index 57% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Quota.cs index 042f27a38c70..6ca3bdb32d80 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Quota.cs @@ -3,35 +3,35 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Subscription quotas public partial class Quota : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled? _enabled; + private string _enabled; /// Host quota is active for current subscription [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled? Enabled { get => this._enabled; } + public string Enabled { get => this._enabled; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining _hostsRemaining; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining _hostsRemaining; /// Remaining hosts quota by sku type [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining HostsRemaining { get => (this._hostsRemaining = this._hostsRemaining ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemaining()); } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining HostsRemaining { get => (this._hostsRemaining = this._hostsRemaining ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemaining()); } /// Internal Acessors for Enabled - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal.Enabled { get => this._enabled; set { {_enabled = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal.Enabled { get => this._enabled; set { {_enabled = value;} } } /// Internal Acessors for HostsRemaining - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaInternal.HostsRemaining { get => (this._hostsRemaining = this._hostsRemaining ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemaining()); set { {_hostsRemaining = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaInternal.HostsRemaining { get => (this._hostsRemaining = this._hostsRemaining ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemaining()); set { {_hostsRemaining = value;} } } /// Creates an new instance. public Quota() @@ -47,18 +47,25 @@ public partial interface IQuota : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Host quota is active for current subscription", SerializedName = @"quotaEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled? Enabled { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Enabled { get; } /// Remaining hosts quota by sku type [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Remaining hosts quota by sku type", SerializedName = @"hostsRemaining", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining HostsRemaining { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining HostsRemaining { get; } } /// Subscription quotas @@ -66,9 +73,10 @@ internal partial interface IQuotaInternal { /// Host quota is active for current subscription - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled? Enabled { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string Enabled { get; set; } /// Remaining hosts quota by sku type - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining HostsRemaining { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining HostsRemaining { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Quota.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Quota.json.cs index 0b36539063aa..16ceeab11535 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Quota.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Quota.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Quota partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Quota(json) : null; } @@ -77,8 +75,8 @@ internal Quota(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject { return; } - {_hostsRemaining = If( json?.PropertyT("hostsRemaining"), out var __jsonHostsRemaining) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.QuotaHostsRemaining.FromJson(__jsonHostsRemaining) : HostsRemaining;} - {_enabled = If( json?.PropertyT("quotaEnabled"), out var __jsonQuotaEnabled) ? (string)__jsonQuotaEnabled : (string)Enabled;} + {_hostsRemaining = If( json?.PropertyT("hostsRemaining"), out var __jsonHostsRemaining) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemaining.FromJson(__jsonHostsRemaining) : _hostsRemaining;} + {_enabled = If( json?.PropertyT("quotaEnabled"), out var __jsonQuotaEnabled) ? (string)__jsonQuotaEnabled : (string)_enabled;} AfterFromJson(json); } @@ -101,11 +99,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._hostsRemaining ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._hostsRemaining.ToJson(null,serializationMode) : null, "hostsRemaining" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._enabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._enabled.ToString()) : null, "quotaEnabled" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.PowerShell.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.PowerShell.cs index c44645258454..3b7389363530 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class QuotaHostsRemaining partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IQuotaHostsRemaining DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new QuotaHostsRemaining(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.VMware.Models.Api20211201.IQuotaHostsRemaining DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new QuotaHostsRemaining(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuot /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -115,7 +115,7 @@ internal QuotaHostsRemaining(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/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.TypeConverter.cs index 72452252e47f..9221d686a17b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IQuotaHostsRemaining ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.cs b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.cs rename to src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.cs index b2cac52d58ec..762202102d5b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Remaining hosts quota by sku type public partial class QuotaHostsRemaining : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemainingInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemainingInternal { /// Creates an new instance. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.dictionary.cs b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.dictionary.cs similarity index 95% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.dictionary.cs rename to src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.dictionary.cs index 0cb5fea7240d..804f6a9ded5e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.dictionary.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.QuotaHostsRemaining source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.QuotaHostsRemaining source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.json.cs similarity index 95% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.json.cs index 777b4a1470fd..4f829b5329b1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/QuotaHostsRemaining.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/QuotaHostsRemaining.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class QuotaHostsRemaining partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuotaHostsRemaining FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuotaHostsRemaining FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new QuotaHostsRemaining(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Resource.PowerShell.cs similarity index 80% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Resource.PowerShell.cs index 1f25b08e00fd..654e6ef80be5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Resource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Resource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Resource(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.VMware.Models.Api20211201.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Resource(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IReso /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,21 +111,21 @@ internal Resource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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. @@ -140,15 +140,15 @@ internal Resource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Resource.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Resource.TypeConverter.cs index 232c435449d8..6566136aea0a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Resource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.cs b/src/VMware/VMware.Autorest/generated/api/Models/Resource.cs similarity index 84% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Resource.cs index 3352f374d3fa..de7af4005a3c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Resource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The core properties of ARM resources public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// Backing field for property. @@ -21,13 +21,13 @@ public partial class Resource : public string Id { get => this._id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -57,6 +57,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource ID.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource name.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface IResource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Resource type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Resource.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Resource.json.cs index 3333ec73aa4a..c7c7fa4f2f85 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Resource.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Resource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Resource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Resource(json) : null; } @@ -77,9 +75,9 @@ internal Resource(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObj { return; } - {_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;} + {_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); } @@ -102,15 +100,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.PowerShell.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.PowerShell.cs index f1bed62e33ad..adccf11bfc6a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ResourceTags partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ResourceTags(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.VMware.Models.Api20211201.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ResourceTags(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IReso /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -115,7 +115,7 @@ internal ResourceTags(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/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.TypeConverter.cs index 295c09e0fb70..ff3ef57bd724 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IResourceTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.cs b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.cs index 481ef8f4e639..ca383d649af3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Resource tags public partial class ResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTagsInternal { /// Creates an new instance. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.dictionary.cs b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.dictionary.cs similarity index 95% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.dictionary.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.dictionary.cs index 74401815d100..779f147593e2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.dictionary.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ResourceTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.json.cs index 4073de97162b..5d3535f0a6c4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ResourceTags.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ResourceTags.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class ResourceTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ResourceTags(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.PowerShell.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.PowerShell.cs index 7bc62827ba95..03c8ba190f84 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptCmdlet partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptCmdlet DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptCmdlet(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.VMware.Models.Api20211201.IScriptCmdlet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptCmdlet(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,37 +111,37 @@ internal ScriptCmdlet(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Timeout")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Timeout, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Timeout, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameterTypeConverter.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. @@ -156,31 +156,31 @@ internal ScriptCmdlet(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Timeout")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Timeout, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Timeout, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameterTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.TypeConverter.cs index 99ad27dc58f7..4e0c44f757da 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdlet ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.cs similarity index 60% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.cs index 1feef12cf815..2408ce82ddae 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.cs @@ -3,65 +3,64 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A cmdlet available for script execution public partial class ScriptCmdlet : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Description of the scripts functionality [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Description; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Description; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Description = value; } /// Internal Acessors for Parameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal.Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Parameter = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal.Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Parameter = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletProperties()); set { {_property = value;} } } /// Internal Acessors for Timeout - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletInternal.Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Timeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Timeout = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletInternal.Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Timeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Timeout = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Parameters the script will accept [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Parameter; } + public System.Collections.Generic.List Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Parameter; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties _property; /// The properties of a script cmdlet resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -69,11 +68,11 @@ public partial class ScriptCmdlet : /// Recommended time limit for execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)Property).Timeout; } + public string Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)Property).Timeout; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Creates an new instance. public ScriptCmdlet() @@ -89,19 +88,22 @@ public ScriptCmdlet() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// A cmdlet available for script execution public partial interface IScriptCmdlet : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Description of the scripts functionality [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the scripts functionality", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -110,14 +112,20 @@ public partial interface IScriptCmdlet : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Parameters the script will accept", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Parameter { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter) })] + System.Collections.Generic.List Parameter { get; } /// Recommended time limit for execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Recommended time limit for execution", SerializedName = @"timeout", PossibleTypes = new [] { typeof(string) })] @@ -126,14 +134,14 @@ public partial interface IScriptCmdlet : } /// A cmdlet available for script execution internal partial interface IScriptCmdletInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Description of the scripts functionality string Description { get; set; } /// Parameters the script will accept - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// The properties of a script cmdlet resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties Property { get; set; } /// Recommended time limit for execution string Timeout { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.json.cs index c4d82f2297db..627d9430e362 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdlet.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdlet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class ScriptCmdlet partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptCmdlet(json) : null; } @@ -77,8 +75,8 @@ internal ScriptCmdlet(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Jso { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.PowerShell.cs similarity index 73% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.PowerShell.cs index 20a76f6ea0b1..c7ccb8965e6c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptCmdletProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptCmdletProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptCmdletProperties(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.VMware.Models.Api20211201.IScriptCmdletProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptCmdletProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,21 +111,21 @@ internal ScriptCmdletProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Timeout")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Timeout, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Timeout, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameterTypeConverter.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. @@ -140,15 +140,15 @@ internal ScriptCmdletProperties(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Timeout")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Timeout, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Timeout, global::System.Convert.ToString); } if (content.Contains("Parameter")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[]) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameterTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.TypeConverter.cs index a1afaef270cf..4bb2fdc2a209 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdletProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.cs index e9a4f4cfaf53..b97f13146a1b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Properties of a pre-canned script public partial class ScriptCmdletProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal { /// Backing field for property. @@ -21,20 +21,20 @@ public partial class ScriptCmdletProperties : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Parameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal.Parameter { get => this._parameter; set { {_parameter = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal.Parameter { get => this._parameter; set { {_parameter = value;} } } /// Internal Acessors for Timeout - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletPropertiesInternal.Timeout { get => this._timeout; set { {_timeout = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletPropertiesInternal.Timeout { get => this._timeout; set { {_timeout = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] _parameter; + private System.Collections.Generic.List _parameter; /// Parameters the script will accept [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Parameter { get => this._parameter; } + public System.Collections.Generic.List Parameter { get => this._parameter; } /// Backing field for property. private string _timeout; @@ -57,6 +57,9 @@ public partial interface IScriptCmdletProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Description of the scripts functionality", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -65,14 +68,20 @@ public partial interface IScriptCmdletProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Parameters the script will accept", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Parameter { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter) })] + System.Collections.Generic.List Parameter { get; } /// Recommended time limit for execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Recommended time limit for execution", SerializedName = @"timeout", PossibleTypes = new [] { typeof(string) })] @@ -86,7 +95,7 @@ internal partial interface IScriptCmdletPropertiesInternal /// Description of the scripts functionality string Description { get; set; } /// Parameters the script will accept - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// Recommended time limit for execution string Timeout { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.json.cs index 364e592099d5..e1d21f22fb51 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptCmdletProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptCmdletProperties(json) : null; } @@ -77,9 +77,9 @@ internal ScriptCmdletProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_timeout = If( json?.PropertyT("timeout"), out var __jsonTimeout) ? (string)__jsonTimeout : (string)Timeout;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptParameter) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptParameter.FromJson(__u) )) ))() : null : Parameter;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_timeout = If( json?.PropertyT("timeout"), out var __jsonTimeout) ? (string)__jsonTimeout : (string)_timeout;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.IScriptParameter) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptParameter.FromJson(__u) )) ))() : null : _parameter;} AfterFromJson(json); } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._timeout)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._timeout.ToString()) : null, "timeout" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._parameter) { diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.PowerShell.cs index 385eeac40575..dcecd2bc14d6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptCmdletsList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptCmdletsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptCmdletsList(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.VMware.Models.Api20211201.IScriptCmdletsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptCmdletsList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal ScriptCmdletsList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).NextLink, 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,11 +136,11 @@ internal ScriptCmdletsList(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.TypeConverter.cs index d590c5091cfc..148e0ea17161 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdletsList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.cs index eb1764bef988..c043834fb570 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Pageable list of scripts/cmdlets public partial class ScriptCmdletsList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ScriptCmdletsList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[] _value; + private System.Collections.Generic.List _value; /// List of scripts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ScriptCmdletsList() @@ -47,6 +47,9 @@ public partial interface IScriptCmdletsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IScriptCmdletsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of scripts", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet) })] + System.Collections.Generic.List Value { get; } } /// Pageable list of scripts/cmdlets @@ -68,7 +74,7 @@ internal partial interface IScriptCmdletsListInternal /// URL to get the next page if any string NextLink { get; set; } /// List of scripts - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.json.cs index b6e560356f78..b7a19a503a58 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptCmdletsList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptCmdletsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptCmdletsList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdletsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptCmdletsList(json) : null; } @@ -77,8 +77,8 @@ internal ScriptCmdletsList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Jso { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdlet) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdlet.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.VMware.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.VMware.Models.IScriptCmdlet) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdlet.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.PowerShell.cs new file mode 100644 index 000000000000..868fac2fc774 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.PowerShell.cs @@ -0,0 +1,308 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// An instance of a script executed by a user - custom or AVS + [System.ComponentModel.TypeConverter(typeof(ScriptExecutionTypeConverter))] + public partial class ScriptExecution + { + + /// + /// 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.VMware.Models.IScriptExecution DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScriptExecution(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.VMware.Models.IScriptExecution DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScriptExecution(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.VMware.Models.IScriptExecution FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScriptExecution(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.VMware.Models.IScriptExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ScriptCmdletId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ScriptCmdletId, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("HiddenParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).HiddenParameter = (System.Collections.Generic.List) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Timeout, global::System.Convert.ToString); + } + if (content.Contains("Retention")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Retention, global::System.Convert.ToString); + } + if (content.Contains("SubmittedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Output = (System.Collections.Generic.List) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Output, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NamedOutput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); + } + if (content.Contains("Information")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Information = (System.Collections.Generic.List) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Information, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Warning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Warning = (System.Collections.Generic.List) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Warning, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Error, __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 ScriptExecution(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.VMware.Models.IScriptExecutionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ScriptCmdletId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ScriptCmdletId, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("HiddenParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).HiddenParameter = (System.Collections.Generic.List) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Timeout, global::System.Convert.ToString); + } + if (content.Contains("Retention")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Retention, global::System.Convert.ToString); + } + if (content.Contains("SubmittedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Output = (System.Collections.Generic.List) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Output, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NamedOutput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); + } + if (content.Contains("Information")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Information = (System.Collections.Generic.List) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Information, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Warning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Warning = (System.Collections.Generic.List) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Warning, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal)this).Error, __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.VMware.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(); + } + } + /// An instance of a script executed by a user - custom or AVS + [System.ComponentModel.TypeConverter(typeof(ScriptExecutionTypeConverter))] + public partial interface IScriptExecution + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.TypeConverter.cs index 3c58f3856ed1..ac58c86652a6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.cs similarity index 59% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.cs index 0ec57b51044f..e59f8a5975f3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.cs @@ -3,109 +3,108 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An instance of a script executed by a user - custom or AVS public partial class ScriptExecution : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Standard error output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Error; } + public System.Collections.Generic.List Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Error; } /// /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string FailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).FailureReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).FailureReason = value ?? null; } + public string FailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).FailureReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).FailureReason = value ?? null; } /// Time the script execution was finished [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public global::System.DateTime? FinishedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).FinishedAt; } + public global::System.DateTime? FinishedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).FinishedAt; } /// /// Parameters that will be hidden/not visible to ARM, such as passwords and credentials /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).HiddenParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).HiddenParameter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List HiddenParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).HiddenParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).HiddenParameter = value ?? null /* arrayOf */; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Standard information out stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Information { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Information; } + public System.Collections.Generic.List Information { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Information; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Error - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Error = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.Error { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Error; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Error = value; } /// Internal Acessors for FinishedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.FinishedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).FinishedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).FinishedAt = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.FinishedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).FinishedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).FinishedAt = value; } /// Internal Acessors for Information - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.Information { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Information; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Information = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.Information { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Information; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Information = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for StartedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.StartedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).StartedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).StartedAt = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.StartedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).StartedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).StartedAt = value; } /// Internal Acessors for SubmittedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.SubmittedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).SubmittedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).SubmittedAt = value; } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.SubmittedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).SubmittedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).SubmittedAt = value; } /// Internal Acessors for Warning - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionInternal.Warning { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Warning; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Warning = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionInternal.Warning { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Warning; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Warning = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// User-defined dictionary. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).NamedOutput; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).NamedOutput = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).NamedOutput; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).NamedOutput = value ?? null /* model class */; } /// Standard output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Output { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Output; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Output = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Output { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Output; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Output = value ?? null /* arrayOf */; } /// Parameters the script will accept [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Parameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Parameter = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties _property; /// The properties of a script execution resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionProperties()); set => this._property = value; } /// The state of the script execution resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -113,31 +112,31 @@ public partial class ScriptExecution : /// Time to live for the resource. If not provided, will be available for 60 days [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Retention { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Retention; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Retention = value ?? null; } + public string Retention { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Retention; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Retention = value ?? null; } /// A reference to the script cmdlet resource if user is running a AVS script [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ScriptCmdletId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).ScriptCmdletId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).ScriptCmdletId = value ?? null; } + public string ScriptCmdletId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).ScriptCmdletId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).ScriptCmdletId = value ?? null; } /// Time the script execution was started [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public global::System.DateTime? StartedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).StartedAt; } + public global::System.DateTime? StartedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).StartedAt; } /// Time the script execution was submitted [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public global::System.DateTime? SubmittedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).SubmittedAt; } + public global::System.DateTime? SubmittedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).SubmittedAt; } /// Time limit for execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Timeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Timeout = value ?? null; } + public string Timeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Timeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Timeout = value ?? null; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Standard warning out stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Warning { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal)Property).Warning; } + public System.Collections.Generic.List Warning { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)Property).Warning; } /// Creates an new instance. public ScriptExecution() @@ -153,29 +152,35 @@ public ScriptExecution() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// An instance of a script executed by a user - custom or AVS public partial interface IScriptExecution : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Standard error output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Standard error output stream from the powershell execution", SerializedName = @"errors", PossibleTypes = new [] { typeof(string) })] - string[] Error { get; } + System.Collections.Generic.List Error { get; } /// /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error message if the script was able to run, but if the script itself had errors or powershell threw an exception", SerializedName = @"failureReason", PossibleTypes = new [] { typeof(string) })] @@ -184,6 +189,9 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Time the script execution was finished", SerializedName = @"finishedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -194,54 +202,76 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parameters that will be hidden/not visible to ARM, such as passwords and credentials", SerializedName = @"hiddenParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + System.Collections.Generic.List HiddenParameter { get; set; } /// Standard information out stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Standard information out stream from the powershell execution", SerializedName = @"information", PossibleTypes = new [] { typeof(string) })] - string[] Information { get; } + System.Collections.Generic.List Information { get; } /// User-defined dictionary. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User-defined dictionary.", SerializedName = @"namedOutputs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } /// Standard output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Standard output stream from the powershell execution", SerializedName = @"output", PossibleTypes = new [] { typeof(string) })] - string[] Output { get; set; } + System.Collections.Generic.List Output { get; set; } /// Parameters the script will accept [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parameters the script will accept", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// The state of the script execution resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the script execution resource", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Pending", "Running", "Succeeded", "Failed", "Cancelling", "Cancelled", "Deleting", "Canceled")] + string ProvisioningState { get; } /// Time to live for the resource. If not provided, will be available for 60 days [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Time to live for the resource. If not provided, will be available for 60 days", SerializedName = @"retention", PossibleTypes = new [] { typeof(string) })] @@ -250,6 +280,9 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A reference to the script cmdlet resource if user is running a AVS script", SerializedName = @"scriptCmdletId", PossibleTypes = new [] { typeof(string) })] @@ -258,6 +291,9 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Time the script execution was started", SerializedName = @"startedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -266,6 +302,9 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Time the script execution was submitted", SerializedName = @"submittedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -274,6 +313,9 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Time limit for execution", SerializedName = @"timeout", PossibleTypes = new [] { typeof(string) })] @@ -282,18 +324,21 @@ public partial interface IScriptExecution : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Standard warning out stream from the powershell execution", SerializedName = @"warnings", PossibleTypes = new [] { typeof(string) })] - string[] Warning { get; } + System.Collections.Generic.List Warning { get; } } /// An instance of a script executed by a user - custom or AVS internal partial interface IScriptExecutionInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Standard error output stream from the powershell execution - string[] Error { get; set; } + System.Collections.Generic.List Error { get; set; } /// /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception /// @@ -303,19 +348,20 @@ internal partial interface IScriptExecutionInternal : /// /// Parameters that will be hidden/not visible to ARM, such as passwords and credentials /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get; set; } + System.Collections.Generic.List HiddenParameter { get; set; } /// Standard information out stream from the powershell execution - string[] Information { get; set; } + System.Collections.Generic.List Information { get; set; } /// User-defined dictionary. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } /// Standard output stream from the powershell execution - string[] Output { get; set; } + System.Collections.Generic.List Output { get; set; } /// Parameters the script will accept - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// The properties of a script execution resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties Property { get; set; } /// The state of the script execution resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Pending", "Running", "Succeeded", "Failed", "Cancelling", "Cancelled", "Deleting", "Canceled")] + string ProvisioningState { get; set; } /// Time to live for the resource. If not provided, will be available for 60 days string Retention { get; set; } /// A reference to the script cmdlet resource if user is running a AVS script @@ -327,7 +373,7 @@ internal partial interface IScriptExecutionInternal : /// Time limit for execution string Timeout { get; set; } /// Standard warning out stream from the powershell execution - string[] Warning { get; set; } + System.Collections.Generic.List Warning { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.json.cs index 21a869add9f7..9e4f74f5ff01 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecution.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecution.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptExecution partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptExecution(json) : null; } @@ -77,8 +77,8 @@ internal ScriptExecution(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json. { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.PowerShell.cs index ec8c4b189b9e..4c5e0da70426 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptExecutionParameter partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptExecutionParameter(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.VMware.Models.Api20211201.IScriptExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptExecutionParameter(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal ScriptExecutionParameter(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, 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,11 +136,11 @@ internal ScriptExecutionParameter(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.TypeConverter.cs index eb1d9f982e7f..0df754c428f1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecutionParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.cs similarity index 73% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.cs index 36047b0b5109..982460ed4596 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The arguments passed in to the execution public partial class ScriptExecutionParameter : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ScriptExecutionParameter : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType _type; + private string _type; /// The type of execution parameter [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public ScriptExecutionParameter() @@ -41,6 +41,9 @@ public partial interface IScriptExecutionParameter : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The parameter name", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,14 @@ public partial interface IScriptExecutionParameter : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of execution parameter", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Value", "SecureValue", "Credential")] + string Type { get; set; } } /// The arguments passed in to the execution @@ -62,7 +69,8 @@ internal partial interface IScriptExecutionParameterInternal /// The parameter name string Name { get; set; } /// The type of execution parameter - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Value", "SecureValue", "Credential")] + string Type { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.json.cs index 16a87c083be3..12ddd092e65d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionParameter.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,15 +54,15 @@ public partial class ScriptExecutionParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter interface is polymorphic, and the + /// precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json)) { @@ -100,8 +100,8 @@ internal ScriptExecutionParameter(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runt { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_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/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.PowerShell.cs new file mode 100644 index 000000000000..bb23f780686e --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// Properties of a user-invoked script + [System.ComponentModel.TypeConverter(typeof(ScriptExecutionPropertiesTypeConverter))] + public partial class ScriptExecutionProperties + { + + /// + /// 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.VMware.Models.IScriptExecutionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ScriptExecutionProperties(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.VMware.Models.IScriptExecutionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ScriptExecutionProperties(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.VMware.Models.IScriptExecutionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ScriptExecutionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScriptCmdletId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ScriptCmdletId, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("HiddenParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).HiddenParameter = (System.Collections.Generic.List) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Timeout, global::System.Convert.ToString); + } + if (content.Contains("Retention")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Retention, global::System.Convert.ToString); + } + if (content.Contains("SubmittedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Output = (System.Collections.Generic.List) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NamedOutput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); + } + if (content.Contains("Information")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Information = (System.Collections.Generic.List) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Information, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Warning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Warning = (System.Collections.Generic.List) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Warning, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Error, __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 ScriptExecutionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ScriptCmdletId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ScriptCmdletId = (string) content.GetValueForProperty("ScriptCmdletId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ScriptCmdletId, global::System.Convert.ToString); + } + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Parameter = (System.Collections.Generic.List) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Parameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("HiddenParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).HiddenParameter = (System.Collections.Generic.List) content.GetValueForProperty("HiddenParameter",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).HiddenParameter, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameterTypeConverter.ConvertFrom)); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("Timeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Timeout = (string) content.GetValueForProperty("Timeout",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Timeout, global::System.Convert.ToString); + } + if (content.Contains("Retention")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Retention = (string) content.GetValueForProperty("Retention",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Retention, global::System.Convert.ToString); + } + if (content.Contains("SubmittedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).SubmittedAt = (global::System.DateTime?) content.GetValueForProperty("SubmittedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).SubmittedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("StartedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).StartedAt = (global::System.DateTime?) content.GetValueForProperty("StartedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).StartedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FinishedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FinishedAt = (global::System.DateTime?) content.GetValueForProperty("FinishedAt",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).FinishedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Output")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Output = (System.Collections.Generic.List) content.GetValueForProperty("Output",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Output, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NamedOutput")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).NamedOutput = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) content.GetValueForProperty("NamedOutput",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).NamedOutput, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputsTypeConverter.ConvertFrom); + } + if (content.Contains("Information")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Information = (System.Collections.Generic.List) content.GetValueForProperty("Information",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Information, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Warning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Warning = (System.Collections.Generic.List) content.GetValueForProperty("Warning",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Warning, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Error = (System.Collections.Generic.List) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal)this).Error, __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.VMware.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(); + } + } + /// Properties of a user-invoked script + [System.ComponentModel.TypeConverter(typeof(ScriptExecutionPropertiesTypeConverter))] + public partial interface IScriptExecutionProperties + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.TypeConverter.cs index 17ce18930c69..9e01f7f81f01 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecutionProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.cs similarity index 70% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.cs index deaeb23d9dda..0cf27453ab2b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Properties of a user-invoked script public partial class ScriptExecutionProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal { /// Backing field for property. - private string[] _error; + private System.Collections.Generic.List _error; /// Standard error output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Error { get => this._error; } + public System.Collections.Generic.List Error { get => this._error; } /// Backing field for property. private string _failureReason; @@ -37,69 +37,69 @@ public partial class ScriptExecutionProperties : public global::System.DateTime? FinishedAt { get => this._finishedAt; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] _hiddenParameter; + private System.Collections.Generic.List _hiddenParameter; /// /// Parameters that will be hidden/not visible to ARM, such as passwords and credentials /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get => this._hiddenParameter; set => this._hiddenParameter = value; } + public System.Collections.Generic.List HiddenParameter { get => this._hiddenParameter; set => this._hiddenParameter = value; } /// Backing field for property. - private string[] _information; + private System.Collections.Generic.List _information; /// Standard information out stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Information { get => this._information; } + public System.Collections.Generic.List Information { get => this._information; } /// Internal Acessors for Error - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.Error { get => this._error; set { {_error = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.Error { get => this._error; set { {_error = value;} } } /// Internal Acessors for FinishedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.FinishedAt { get => this._finishedAt; set { {_finishedAt = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.FinishedAt { get => this._finishedAt; set { {_finishedAt = value;} } } /// Internal Acessors for Information - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.Information { get => this._information; set { {_information = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.Information { get => this._information; set { {_information = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for StartedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.StartedAt { get => this._startedAt; set { {_startedAt = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.StartedAt { get => this._startedAt; set { {_startedAt = value;} } } /// Internal Acessors for SubmittedAt - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.SubmittedAt { get => this._submittedAt; set { {_submittedAt = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.SubmittedAt { get => this._submittedAt; set { {_submittedAt = value;} } } /// Internal Acessors for Warning - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesInternal.Warning { get => this._warning; set { {_warning = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesInternal.Warning { get => this._warning; set { {_warning = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs _namedOutput; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs _namedOutput; /// User-defined dictionary. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => (this._namedOutput = this._namedOutput ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputs()); set => this._namedOutput = value; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => (this._namedOutput = this._namedOutput ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputs()); set => this._namedOutput = value; } /// Backing field for property. - private string[] _output; + private System.Collections.Generic.List _output; /// Standard output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Output { get => this._output; set => this._output = value; } + public System.Collections.Generic.List Output { get => this._output; set => this._output = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] _parameter; + private System.Collections.Generic.List _parameter; /// Parameters the script will accept [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get => this._parameter; set => this._parameter = value; } + public System.Collections.Generic.List Parameter { get => this._parameter; set => this._parameter = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? _provisioningState; + private string _provisioningState; /// The state of the script execution resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private string _retention; @@ -137,11 +137,11 @@ public partial class ScriptExecutionProperties : public string Timeout { get => this._timeout; set => this._timeout = value; } /// Backing field for property. - private string[] _warning; + private System.Collections.Generic.List _warning; /// Standard warning out stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Warning { get => this._warning; } + public System.Collections.Generic.List Warning { get => this._warning; } /// Creates an new instance. public ScriptExecutionProperties() @@ -157,16 +157,22 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Standard error output stream from the powershell execution", SerializedName = @"errors", PossibleTypes = new [] { typeof(string) })] - string[] Error { get; } + System.Collections.Generic.List Error { get; } /// /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Error message if the script was able to run, but if the script itself had errors or powershell threw an exception", SerializedName = @"failureReason", PossibleTypes = new [] { typeof(string) })] @@ -175,6 +181,9 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Time the script execution was finished", SerializedName = @"finishedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -185,54 +194,76 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parameters that will be hidden/not visible to ARM, such as passwords and credentials", SerializedName = @"hiddenParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + System.Collections.Generic.List HiddenParameter { get; set; } /// Standard information out stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Standard information out stream from the powershell execution", SerializedName = @"information", PossibleTypes = new [] { typeof(string) })] - string[] Information { get; } + System.Collections.Generic.List Information { get; } /// User-defined dictionary. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"User-defined dictionary.", SerializedName = @"namedOutputs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } /// Standard output stream from the powershell execution [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Standard output stream from the powershell execution", SerializedName = @"output", PossibleTypes = new [] { typeof(string) })] - string[] Output { get; set; } + System.Collections.Generic.List Output { get; set; } /// Parameters the script will accept [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Parameters the script will accept", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + System.Collections.Generic.List Parameter { get; set; } /// The state of the script execution resource [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The state of the script execution resource", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Pending", "Running", "Succeeded", "Failed", "Cancelling", "Cancelled", "Deleting", "Canceled")] + string ProvisioningState { get; } /// Time to live for the resource. If not provided, will be available for 60 days [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Time to live for the resource. If not provided, will be available for 60 days", SerializedName = @"retention", PossibleTypes = new [] { typeof(string) })] @@ -241,6 +272,9 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A reference to the script cmdlet resource if user is running a AVS script", SerializedName = @"scriptCmdletId", PossibleTypes = new [] { typeof(string) })] @@ -249,6 +283,9 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Time the script execution was started", SerializedName = @"startedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -257,6 +294,9 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Time the script execution was submitted", SerializedName = @"submittedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -265,6 +305,9 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Time limit for execution", SerializedName = @"timeout", PossibleTypes = new [] { typeof(string) })] @@ -273,10 +316,13 @@ public partial interface IScriptExecutionProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Standard warning out stream from the powershell execution", SerializedName = @"warnings", PossibleTypes = new [] { typeof(string) })] - string[] Warning { get; } + System.Collections.Generic.List Warning { get; } } /// Properties of a user-invoked script @@ -284,7 +330,7 @@ internal partial interface IScriptExecutionPropertiesInternal { /// Standard error output stream from the powershell execution - string[] Error { get; set; } + System.Collections.Generic.List Error { get; set; } /// /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception /// @@ -294,17 +340,18 @@ internal partial interface IScriptExecutionPropertiesInternal /// /// Parameters that will be hidden/not visible to ARM, such as passwords and credentials /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get; set; } + System.Collections.Generic.List HiddenParameter { get; set; } /// Standard information out stream from the powershell execution - string[] Information { get; set; } + System.Collections.Generic.List Information { get; set; } /// User-defined dictionary. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get; set; } /// Standard output stream from the powershell execution - string[] Output { get; set; } + System.Collections.Generic.List Output { get; set; } /// Parameters the script will accept - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get; set; } + System.Collections.Generic.List Parameter { get; set; } /// The state of the script execution resource - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Pending", "Running", "Succeeded", "Failed", "Cancelling", "Cancelled", "Deleting", "Canceled")] + string ProvisioningState { get; set; } /// Time to live for the resource. If not provided, will be available for 60 days string Retention { get; set; } /// A reference to the script cmdlet resource if user is running a AVS script @@ -316,7 +363,7 @@ internal partial interface IScriptExecutionPropertiesInternal /// Time limit for execution string Timeout { get; set; } /// Standard warning out stream from the powershell execution - string[] Warning { get; set; } + System.Collections.Generic.List Warning { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.json.cs similarity index 83% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.json.cs index 3f23dd0de61d..85f4f45681f3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptExecutionProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptExecutionProperties(json) : null; } @@ -77,21 +77,21 @@ internal ScriptExecutionProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - {_scriptCmdletId = If( json?.PropertyT("scriptCmdletId"), out var __jsonScriptCmdletId) ? (string)__jsonScriptCmdletId : (string)ScriptCmdletId;} - {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecutionParameter) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter.FromJson(__u) )) ))() : null : Parameter;} - {_hiddenParameter = If( json?.PropertyT("hiddenParameters"), out var __jsonHiddenParameters) ? If( __jsonHiddenParameters as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter.FromJson(__p) )) ))() : null : HiddenParameter;} - {_failureReason = If( json?.PropertyT("failureReason"), out var __jsonFailureReason) ? (string)__jsonFailureReason : (string)FailureReason;} - {_timeout = If( json?.PropertyT("timeout"), out var __jsonTimeout) ? (string)__jsonTimeout : (string)Timeout;} - {_retention = If( json?.PropertyT("retention"), out var __jsonRetention) ? (string)__jsonRetention : (string)Retention;} - {_submittedAt = If( json?.PropertyT("submittedAt"), out var __jsonSubmittedAt) ? global::System.DateTime.TryParse((string)__jsonSubmittedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSubmittedAtValue) ? __jsonSubmittedAtValue : SubmittedAt : SubmittedAt;} - {_startedAt = If( json?.PropertyT("startedAt"), out var __jsonStartedAt) ? global::System.DateTime.TryParse((string)__jsonStartedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedAtValue) ? __jsonStartedAtValue : StartedAt : StartedAt;} - {_finishedAt = If( json?.PropertyT("finishedAt"), out var __jsonFinishedAt) ? global::System.DateTime.TryParse((string)__jsonFinishedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFinishedAtValue) ? __jsonFinishedAtValue : FinishedAt : FinishedAt;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : Output;} - {_namedOutput = If( json?.PropertyT("namedOutputs"), out var __jsonNamedOutputs) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputs.FromJson(__jsonNamedOutputs) : NamedOutput;} - {_information = If( json?.PropertyT("information"), out var __jsonInformation) ? If( __jsonInformation as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : Information;} - {_warning = If( json?.PropertyT("warnings"), out var __jsonWarnings) ? If( __jsonWarnings as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : Warning;} - {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : Error;} + {_scriptCmdletId = If( json?.PropertyT("scriptCmdletId"), out var __jsonScriptCmdletId) ? (string)__jsonScriptCmdletId : (string)_scriptCmdletId;} + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? If( __jsonParameters as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.IScriptExecutionParameter) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter.FromJson(__u) )) ))() : null : _parameter;} + {_hiddenParameter = If( json?.PropertyT("hiddenParameters"), out var __jsonHiddenParameters) ? If( __jsonHiddenParameters as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter.FromJson(__p) )) ))() : null : _hiddenParameter;} + {_failureReason = If( json?.PropertyT("failureReason"), out var __jsonFailureReason) ? (string)__jsonFailureReason : (string)_failureReason;} + {_timeout = If( json?.PropertyT("timeout"), out var __jsonTimeout) ? (string)__jsonTimeout : (string)_timeout;} + {_retention = If( json?.PropertyT("retention"), out var __jsonRetention) ? (string)__jsonRetention : (string)_retention;} + {_submittedAt = If( json?.PropertyT("submittedAt"), out var __jsonSubmittedAt) ? global::System.DateTime.TryParse((string)__jsonSubmittedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSubmittedAtValue) ? __jsonSubmittedAtValue : _submittedAt : _submittedAt;} + {_startedAt = If( json?.PropertyT("startedAt"), out var __jsonStartedAt) ? global::System.DateTime.TryParse((string)__jsonStartedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartedAtValue) ? __jsonStartedAtValue : _startedAt : _startedAt;} + {_finishedAt = If( json?.PropertyT("finishedAt"), out var __jsonFinishedAt) ? global::System.DateTime.TryParse((string)__jsonFinishedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonFinishedAtValue) ? __jsonFinishedAtValue : _finishedAt : _finishedAt;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_output = If( json?.PropertyT("output"), out var __jsonOutput) ? If( __jsonOutput as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _output;} + {_namedOutput = If( json?.PropertyT("namedOutputs"), out var __jsonNamedOutputs) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputs.FromJson(__jsonNamedOutputs) : _namedOutput;} + {_information = If( json?.PropertyT("information"), out var __jsonInformation) ? If( __jsonInformation as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _information;} + {_warning = If( json?.PropertyT("warnings"), out var __jsonWarnings) ? If( __jsonWarnings as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _warning;} + {_error = If( json?.PropertyT("errors"), out var __jsonErrors) ? If( __jsonErrors as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var ___w) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(___w, (___v)=>(string) (___v is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString ___u ? (string)(___u.ToString()) : null)) ))() : null : _error;} AfterFromJson(json); } @@ -136,19 +136,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi AddIf( null != (((object)this._failureReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._failureReason.ToString()) : null, "failureReason" ,container.Add ); AddIf( null != (((object)this._timeout)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._timeout.ToString()) : null, "timeout" ,container.Add ); AddIf( null != (((object)this._retention)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._retention.ToString()) : null, "retention" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._submittedAt ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._submittedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "submittedAt" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._startedAt ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._startedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startedAt" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._finishedAt ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._finishedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "finishedAt" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -162,7 +162,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("output",__m); } AddIf( null != this._namedOutput ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._namedOutput.ToJson(null,serializationMode) : null, "namedOutputs" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._information) { @@ -174,7 +174,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("information",__h); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._warning) { @@ -186,7 +186,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("warnings",__c); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._error) { diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.PowerShell.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.PowerShell.cs index edb3da429977..f86e3f24ac0b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ScriptExecutionPropertiesNamedOutputs partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptExecutionPropertiesNamedOutputs(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.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptExecutionPropertiesNamedOutputs(content); } @@ -98,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -120,7 +118,7 @@ internal ScriptExecutionPropertiesNamedOutputs(global::System.Collections.IDicti } /// - /// 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/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.TypeConverter.cs index c89b530cd44d..83526a655e78 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.cs index 301f7bc027d1..85a3b8837a82 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// User-defined dictionary. public partial class ScriptExecutionPropertiesNamedOutputs : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputsInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputsInternal { /// Creates an new instance. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.dictionary.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.dictionary.cs similarity index 95% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.dictionary.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.dictionary.cs index 8963b04ec7e6..1251234ed15e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.dictionary.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ScriptExecutionPropertiesNamedOutputs source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionPropertiesNamedOutputs source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.json.cs index c4493bffab8c..bff544552d6f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionPropertiesNamedOutputs.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionPropertiesNamedOutputs.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptExecutionPropertiesNamedOutputs partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptExecutionPropertiesNamedOutputs(json) : null; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.PowerShell.cs index 99486335d558..2e447f92b8bc 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptExecutionsList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptExecutionsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptExecutionsList(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.VMware.Models.Api20211201.IScriptExecutionsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptExecutionsList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal ScriptExecutionsList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).NextLink, 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,11 +136,11 @@ internal ScriptExecutionsList(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.TypeConverter.cs index 50152e1edc43..0f925659942b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecutionsList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.cs index 4348a0608e46..61ec3a9e9e2e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Pageable list of script executions public partial class ScriptExecutionsList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ScriptExecutionsList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[] _value; + private System.Collections.Generic.List _value; /// List of scripts [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ScriptExecutionsList() @@ -47,6 +47,9 @@ public partial interface IScriptExecutionsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IScriptExecutionsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of scripts", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution) })] + System.Collections.Generic.List Value { get; } } /// Pageable list of script executions @@ -68,7 +74,7 @@ internal partial interface IScriptExecutionsListInternal /// URL to get the next page if any string NextLink { get; set; } /// List of scripts - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.json.cs index a5a5de705e7d..0e45ca6ab7c5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptExecutionsList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptExecutionsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptExecutionsList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptExecutionsList(json) : null; } @@ -77,8 +77,8 @@ internal ScriptExecutionsList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution.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.VMware.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.VMware.Models.IScriptExecution) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.PowerShell.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.PowerShell.cs index 7a5823d82888..f747227120f2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptPackage partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptPackage DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptPackage(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.VMware.Models.Api20211201.IScriptPackage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptPackage(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,33 +111,41 @@ internal ScriptPackage(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackagePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackagePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Company")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Company = (string) content.GetValueForProperty("Company",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Company, global::System.Convert.ToString); + } + if (content.Contains("Uri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Uri = (string) content.GetValueForProperty("Uri",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Uri, 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. @@ -152,27 +160,35 @@ internal ScriptPackage(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackagePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackagePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Company")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Company = (string) content.GetValueForProperty("Company",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Company, global::System.Convert.ToString); + } + if (content.Contains("Uri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Uri = (string) content.GetValueForProperty("Uri",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal)this).Uri, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.TypeConverter.cs index fb3cea18277a..33263a0b6a1c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackage ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.cs similarity index 50% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.cs index 39082c193382..49046672512a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.cs @@ -3,58 +3,67 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Script Package resources available for execution public partial class ScriptPackage : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); + + /// Company that created and supports the package + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string Company { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Company; } /// User friendly description of the package [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)Property).Description; } + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Description; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } + + /// Internal Acessors for Company + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal.Company { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Company; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Company = value; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)Property).Description = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Description = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageProperties()); set { {_property = value;} } } + + /// Internal Acessors for Uri + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal.Uri { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Uri; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Uri = value; } /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)Property).Version = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Version = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties _property; /// ScriptPackage resource properties [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -62,11 +71,15 @@ public partial class ScriptPackage : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } + + /// Link to support by the package vendor + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] + public string Uri { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Uri; } /// Module version [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)Property).Version; } + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)Property).Version; } /// Creates an new instance. public ScriptPackage() @@ -82,27 +95,55 @@ public ScriptPackage() /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } } /// Script Package resources available for execution public partial interface IScriptPackage : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { + /// Company that created and supports the package + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Company that created and supports the package", + SerializedName = @"company", + PossibleTypes = new [] { typeof(string) })] + string Company { get; } /// User friendly description of the package [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"User friendly description of the package", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] string Description { get; } + /// Link to support by the package vendor + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Link to support by the package vendor", + SerializedName = @"uri", + PossibleTypes = new [] { typeof(string) })] + string Uri { get; } /// Module version [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Module version", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -111,12 +152,16 @@ public partial interface IScriptPackage : } /// Script Package resources available for execution internal partial interface IScriptPackageInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { + /// Company that created and supports the package + string Company { get; set; } /// User friendly description of the package string Description { get; set; } /// ScriptPackage resource properties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties Property { get; set; } + /// Link to support by the package vendor + string Uri { get; set; } /// Module version string Version { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.json.cs index 1ec5c9e7204e..c8f82cff8172 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackage.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackage.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class ScriptPackage partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptPackage(json) : null; } @@ -77,8 +75,8 @@ internal ScriptPackage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.Js { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } @@ -101,7 +99,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.PowerShell.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.PowerShell.cs index 45521f5e5e91..09bd23368b02 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptPackageProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptPackageProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptPackageProperties(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.VMware.Models.Api20211201.IScriptPackageProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptPackageProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,25 @@ internal ScriptPackageProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Company")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Company = (string) content.GetValueForProperty("Company",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Company, global::System.Convert.ToString); + } + if (content.Contains("Uri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Uri = (string) content.GetValueForProperty("Uri",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Uri, 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,11 +144,19 @@ internal ScriptPackageProperties(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Company")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Company = (string) content.GetValueForProperty("Company",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Company, global::System.Convert.ToString); + } + if (content.Contains("Uri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Uri = (string) content.GetValueForProperty("Uri",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal)this).Uri, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.TypeConverter.cs index 9a186e4f5d1c..36a4b3902767 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackageProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.cs similarity index 50% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.cs index f8d607fe234c..ccd5c5a515ac 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.cs @@ -3,16 +3,23 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Properties of a Script Package subresource public partial class ScriptPackageProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal { + /// Backing field for property. + private string _company; + + /// Company that created and supports the package + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string Company { get => this._company; } + /// Backing field for property. private string _description; @@ -20,11 +27,24 @@ public partial class ScriptPackageProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] public string Description { get => this._description; } + /// Internal Acessors for Company + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal.Company { get => this._company; set { {_company = value;} } } + /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Uri + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal.Uri { get => this._uri; set { {_uri = value;} } } /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagePropertiesInternal.Version { get => this._version; set { {_version = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagePropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private string _uri; + + /// Link to support by the package vendor + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string Uri { get => this._uri; } /// Backing field for property. private string _version; @@ -43,18 +63,46 @@ public ScriptPackageProperties() public partial interface IScriptPackageProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable { + /// Company that created and supports the package + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Company that created and supports the package", + SerializedName = @"company", + PossibleTypes = new [] { typeof(string) })] + string Company { get; } /// User friendly description of the package [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"User friendly description of the package", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] string Description { get; } + /// Link to support by the package vendor + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Link to support by the package vendor", + SerializedName = @"uri", + PossibleTypes = new [] { typeof(string) })] + string Uri { get; } /// Module version [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Module version", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -65,8 +113,12 @@ public partial interface IScriptPackageProperties : internal partial interface IScriptPackagePropertiesInternal { + /// Company that created and supports the package + string Company { get; set; } /// User friendly description of the package string Description { get; set; } + /// Link to support by the package vendor + string Uri { get; set; } /// Module version string Version { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.json.cs similarity index 81% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.json.cs index 03adc14defe7..a125e7e300c6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackageProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackageProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptPackageProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackageProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackageProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptPackageProperties(json) : null; } @@ -77,8 +77,10 @@ internal ScriptPackageProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runti { return; } - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} + {_company = If( json?.PropertyT("company"), out var __jsonCompany) ? (string)__jsonCompany : (string)_company;} + {_uri = If( json?.PropertyT("uri"), out var __jsonUri) ? (string)__jsonUri : (string)_uri;} AfterFromJson(json); } @@ -101,14 +103,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._company)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._company.ToString()) : null, "company" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._uri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._uri.ToString()) : null, "uri" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.PowerShell.cs index 054f55c119d1..33b031d14ccd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptPackagesList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptPackagesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptPackagesList(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.VMware.Models.Api20211201.IScriptPackagesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptPackagesList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal ScriptPackagesList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).NextLink, 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,11 +136,11 @@ internal ScriptPackagesList(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackageTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackageTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.TypeConverter.cs index a94e56e020aa..cd585a257dea 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackagesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.cs index 501042a7aa73..c2516df675ef 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of the available script packages public partial class ScriptPackagesList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class ScriptPackagesList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[] _value; + private System.Collections.Generic.List _value; /// List of script package resources [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public ScriptPackagesList() @@ -47,6 +47,9 @@ public partial interface IScriptPackagesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IScriptPackagesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"List of script package resources", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage) })] + System.Collections.Generic.List Value { get; } } /// A list of the available script packages @@ -68,7 +74,7 @@ internal partial interface IScriptPackagesListInternal /// URL to get the next page if any string NextLink { get; set; } /// List of script package resources - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.json.cs index 8f7ac746a1ef..d7e971f3f75a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptPackagesList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptPackagesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptPackagesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackagesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptPackagesList(json) : null; } @@ -77,8 +77,8 @@ internal ScriptPackagesList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Js { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackage) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackage.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.VMware.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.VMware.Models.IScriptPackage) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackage.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } @@ -101,7 +101,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -113,7 +113,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.PowerShell.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.PowerShell.cs index ca12ca7446a7..c76746fb4eca 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ScriptParameter partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptParameter(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.VMware.Models.Api20211201.IScriptParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptParameter(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,29 +111,29 @@ internal ScriptParameter(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Visibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Visibility = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum?) content.GetValueForProperty("Visibility",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Visibility, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Visibility = (string) content.GetValueForProperty("Visibility",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Visibility, global::System.Convert.ToString); } if (content.Contains("Optional")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Optional = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum?) content.GetValueForProperty("Optional",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Optional, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Optional = (string) content.GetValueForProperty("Optional",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Optional, 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. @@ -148,23 +148,23 @@ internal ScriptParameter(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Description, global::System.Convert.ToString); } if (content.Contains("Visibility")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Visibility = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum?) content.GetValueForProperty("Visibility",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Visibility, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Visibility = (string) content.GetValueForProperty("Visibility",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Visibility, global::System.Convert.ToString); } if (content.Contains("Optional")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Optional = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum?) content.GetValueForProperty("Optional",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal)this).Optional, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Optional = (string) content.GetValueForProperty("Optional",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal)this).Optional, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.TypeConverter.cs index ddceefe863f2..cdffd105366e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.cs index e1217db680a5..4151230f5fe5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// An parameter that the script will accept public partial class ScriptParameter : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal { /// Backing field for property. @@ -21,16 +21,16 @@ public partial class ScriptParameter : public string Description { get => this._description; } /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal.Description { get => this._description; set { {_description = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal.Description { get => this._description; set { {_description = value;} } } /// Internal Acessors for Optional - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal.Optional { get => this._optional; set { {_optional = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal.Optional { get => this._optional; set { {_optional = value;} } } /// Internal Acessors for Type - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal.Type { get => this._type; set { {_type = value;} } } /// Internal Acessors for Visibility - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameterInternal.Visibility { get => this._visibility; set { {_visibility = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameterInternal.Visibility { get => this._visibility; set { {_visibility = value;} } } /// Backing field for property. private string _name; @@ -40,29 +40,29 @@ public partial class ScriptParameter : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum? _optional; + private string _optional; /// Is this parameter required or optional [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum? Optional { get => this._optional; } + public string Optional { get => this._optional; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes? _type; + private string _type; /// /// The type of parameter the script is expecting. psCredential is a PSCredentialObject /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes? Type { get => this._type; } + public string Type { get => this._type; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum? _visibility; + private string _visibility; /// /// Should this parameter be visible to arm and passed in the parameters argument when executing /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum? Visibility { get => this._visibility; } + public string Visibility { get => this._visibility; } /// Creates an new instance. public ScriptParameter() @@ -78,6 +78,9 @@ public partial interface IScriptParameter : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"User friendly description of the parameter", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -86,6 +89,9 @@ public partial interface IScriptParameter : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The parameter name that the script will expect a parameter value for", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -94,30 +100,42 @@ public partial interface IScriptParameter : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Is this parameter required or optional", SerializedName = @"optional", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum? Optional { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Optional", "Required")] + string Optional { get; } /// /// The type of parameter the script is expecting. psCredential is a PSCredentialObject /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of parameter the script is expecting. psCredential is a PSCredentialObject", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes? Type { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("String", "SecureString", "Credential", "Int", "Bool", "Float")] + string Type { get; } /// /// Should this parameter be visible to arm and passed in the parameters argument when executing /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Should this parameter be visible to arm and passed in the parameters argument when executing", SerializedName = @"visibility", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum? Visibility { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Visible", "Hidden")] + string Visibility { get; } } /// An parameter that the script will accept @@ -129,15 +147,18 @@ internal partial interface IScriptParameterInternal /// The parameter name that the script will expect a parameter value for string Name { get; set; } /// Is this parameter required or optional - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum? Optional { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Optional", "Required")] + string Optional { get; set; } /// /// The type of parameter the script is expecting. psCredential is a PSCredentialObject /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("String", "SecureString", "Credential", "Int", "Bool", "Float")] + string Type { get; set; } /// /// Should this parameter be visible to arm and passed in the parameters argument when executing /// - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum? Visibility { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Visible", "Hidden")] + string Visibility { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.json.cs index d44869a6ecc4..43eee965e1ab 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptParameter.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptParameter(json) : null; } @@ -77,11 +77,11 @@ internal ScriptParameter(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json. { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_visibility = If( json?.PropertyT("visibility"), out var __jsonVisibility) ? (string)__jsonVisibility : (string)Visibility;} - {_optional = If( json?.PropertyT("optional"), out var __jsonOptional) ? (string)__jsonOptional : (string)Optional;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_visibility = If( json?.PropertyT("visibility"), out var __jsonVisibility) ? (string)__jsonVisibility : (string)_visibility;} + {_optional = If( json?.PropertyT("optional"), out var __jsonOptional) ? (string)__jsonOptional : (string)_optional;} AfterFromJson(json); } @@ -104,20 +104,20 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._visibility)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._visibility.ToString()) : null, "visibility" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._optional)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._optional.ToString()) : null, "optional" ,container.Add ); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.PowerShell.cs similarity index 74% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.PowerShell.cs index f890e7750ee8..55827bf8b882 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ScriptSecureStringExecutionParameter partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptSecureStringExecutionParameter(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.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptSecureStringExecutionParameter(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -115,21 +113,21 @@ internal ScriptSecureStringExecutionParameter(global::System.Collections.IDictio // actually deserialize if (content.Contains("SecureValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameterInternal)this).SecureValue = (string) content.GetValueForProperty("SecureValue",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameterInternal)this).SecureValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameterInternal)this).SecureValue = (string) content.GetValueForProperty("SecureValue",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameterInternal)this).SecureValue, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, 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,15 +142,15 @@ internal ScriptSecureStringExecutionParameter(global::System.Management.Automati // actually deserialize if (content.Contains("SecureValue")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameterInternal)this).SecureValue = (string) content.GetValueForProperty("SecureValue",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameterInternal)this).SecureValue, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameterInternal)this).SecureValue = (string) content.GetValueForProperty("SecureValue",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameterInternal)this).SecureValue, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.TypeConverter.cs index a8bcc21d168e..d9c5525d0d07 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -109,14 +109,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.cs similarity index 72% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.cs index 6f8447595931..ab07ff0a564a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.cs @@ -3,25 +3,25 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// a plain text value execution parameter public partial class ScriptSecureStringExecutionParameter : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameterInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameterInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter(); /// The parameter name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name = value ; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name = value ; } /// Backing field for property. private string _secureValue; @@ -31,13 +31,14 @@ public partial class ScriptSecureStringExecutionParameter : public string SecureValue { get => this._secureValue; set => this._secureValue = value; } /// The type of execution parameter + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type = value ; } + public string Type { get => "SecureValue"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type = "SecureValue"; } /// Creates an new instance. public ScriptSecureStringExecutionParameter() { - + this.__scriptExecutionParameter.Type = "SecureValue"; } /// Validates that this object meets the validation criteria. @@ -55,12 +56,15 @@ public ScriptSecureStringExecutionParameter() /// a plain text value execution parameter public partial interface IScriptSecureStringExecutionParameter : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter { /// A secure value for the passed parameter, not to be stored in logs [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A secure value for the passed parameter, not to be stored in logs", SerializedName = @"secureValue", PossibleTypes = new [] { typeof(string) })] @@ -69,7 +73,7 @@ public partial interface IScriptSecureStringExecutionParameter : } /// a plain text value execution parameter internal partial interface IScriptSecureStringExecutionParameterInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal { /// A secure value for the passed parameter, not to be stored in logs string SecureValue { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.json.cs index d8d809761a8b..3d15130bd4c4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptSecureStringExecutionParameter.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptSecureStringExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptSecureStringExecutionParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptSecureStringExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptSecureStringExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptSecureStringExecutionParameter(json) : null; } @@ -77,8 +77,8 @@ internal ScriptSecureStringExecutionParameter(Microsoft.Azure.PowerShell.Cmdlets { return; } - __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter(json); - {_secureValue = If( json?.PropertyT("secureValue"), out var __jsonSecureValue) ? (string)__jsonSecureValue : (string)SecureValue;} + __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter(json); + {_secureValue = If( json?.PropertyT("secureValue"), out var __jsonSecureValue) ? (string)__jsonSecureValue : (string)_secureValue;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.PowerShell.cs index adc6c5052161..d0a463f3dd91 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class ScriptStringExecutionParameter partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IScriptStringExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ScriptStringExecutionParameter(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.VMware.Models.Api20211201.IScriptStringExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ScriptStringExecutionParameter(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScri /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -113,21 +111,21 @@ internal ScriptStringExecutionParameter(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameterInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameterInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, 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. @@ -142,15 +140,15 @@ internal ScriptStringExecutionParameter(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameterInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameterInternal)this).Value, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.TypeConverter.cs index 2590b9086074..7b74e04fac14 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.cs index a9855b3d3944..31376934453f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.cs @@ -3,29 +3,30 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// a plain text value execution parameter public partial class ScriptStringExecutionParameter : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameterInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameterInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter(); /// The parameter name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name = value ; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Name = value ; } /// The type of execution parameter + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type = value ; } + public string Type { get => "Value"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal)__scriptExecutionParameter).Type = "Value"; } /// Backing field for property. private string _value; @@ -37,7 +38,7 @@ public partial class ScriptStringExecutionParameter : /// Creates an new instance. public ScriptStringExecutionParameter() { - + this.__scriptExecutionParameter.Type = "Value"; } /// Validates that this object meets the validation criteria. @@ -55,12 +56,15 @@ public ScriptStringExecutionParameter() /// a plain text value execution parameter public partial interface IScriptStringExecutionParameter : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter { /// The value for the passed parameter [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value for the passed parameter", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] @@ -69,7 +73,7 @@ public partial interface IScriptStringExecutionParameter : } /// a plain text value execution parameter internal partial interface IScriptStringExecutionParameterInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameterInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameterInternal { /// The value for the passed parameter string Value { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.json.cs index 66f37342eeeb..a656f09b0ff1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ScriptStringExecutionParameter.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ScriptStringExecutionParameter.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ScriptStringExecutionParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptStringExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptStringExecutionParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ScriptStringExecutionParameter(json) : null; } @@ -77,8 +77,8 @@ internal ScriptStringExecutionParameter(Microsoft.Azure.PowerShell.Cmdlets.VMwar { return; } - __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionParameter(json); - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + __scriptExecutionParameter = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionParameter(json); + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.PowerShell.cs similarity index 72% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.PowerShell.cs index d4740df8dee8..81478ee925d7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class ServiceSpecification partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IServiceSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ServiceSpecification(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.VMware.Models.Api20211201.IServiceSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ServiceSpecification(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServ /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,17 +111,17 @@ internal ServiceSpecification(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("LogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).LogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[]) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).LogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("MetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).MetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecificationTypeConverter.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. @@ -136,11 +136,11 @@ internal ServiceSpecification(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("LogSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).LogSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[]) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).LogSpecification = (System.Collections.Generic.List) content.GetValueForProperty("LogSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).LogSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecificationTypeConverter.ConvertFrom)); } if (content.Contains("MetricSpecification")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecificationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).MetricSpecification = (System.Collections.Generic.List) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecificationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.TypeConverter.cs index f20466288195..63264e4daa08 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IServiceSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.cs b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.cs similarity index 58% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.cs index 62e9c4a5b9e4..a27ccb2b8d74 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Service specification payload public partial class ServiceSpecification : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecificationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] _logSpecification; + private System.Collections.Generic.List _logSpecification; /// Specifications of the Log for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] LogSpecification { get => this._logSpecification; set => this._logSpecification = value; } + public System.Collections.Generic.List LogSpecification { get => this._logSpecification; set => this._logSpecification = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] _metricSpecification; + private System.Collections.Generic.List _metricSpecification; /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] MetricSpecification { get => this._metricSpecification; set => this._metricSpecification = value; } + public System.Collections.Generic.List MetricSpecification { get => this._metricSpecification; set => this._metricSpecification = value; } /// Creates an new instance. public ServiceSpecification() @@ -41,18 +41,24 @@ public partial interface IServiceSpecification : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifications of the Log for Azure Monitoring", SerializedName = @"logSpecifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] LogSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ILogSpecification) })] + System.Collections.Generic.List LogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifications of the Metrics for Azure Monitoring", SerializedName = @"metricSpecifications", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] MetricSpecification { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification) })] + System.Collections.Generic.List MetricSpecification { get; set; } } /// Service specification payload @@ -60,9 +66,9 @@ internal partial interface IServiceSpecificationInternal { /// Specifications of the Log for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ILogSpecification[] LogSpecification { get; set; } + System.Collections.Generic.List LogSpecification { get; set; } /// Specifications of the Metrics for Azure Monitoring - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification[] MetricSpecification { get; set; } + System.Collections.Generic.List MetricSpecification { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.json.cs similarity index 86% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.json.cs index 0e00d028eb0e..f2ad7a00d30a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/ServiceSpecification.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/ServiceSpecification.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ServiceSpecification partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new ServiceSpecification(json) : null; } @@ -77,8 +77,8 @@ internal ServiceSpecification(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime. { return; } - {_logSpecification = If( json?.PropertyT("logSpecifications"), out var __jsonLogSpecifications) ? If( __jsonLogSpecifications as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ILogSpecification) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.LogSpecification.FromJson(__u) )) ))() : null : LogSpecification;} - {_metricSpecification = If( json?.PropertyT("metricSpecifications"), out var __jsonMetricSpecifications) ? If( __jsonMetricSpecifications as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IMetricSpecification) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.MetricSpecification.FromJson(__p) )) ))() : null : MetricSpecification;} + {_logSpecification = If( json?.PropertyT("logSpecifications"), out var __jsonLogSpecifications) ? If( __jsonLogSpecifications as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.ILogSpecification) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.LogSpecification.FromJson(__u) )) ))() : null : _logSpecification;} + {_metricSpecification = If( json?.PropertyT("metricSpecifications"), out var __jsonMetricSpecifications) ? If( __jsonMetricSpecifications as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IMetricSpecification) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.MetricSpecification.FromJson(__p) )) ))() : null : _metricSpecification;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Sku.PowerShell.cs similarity index 87% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Sku.PowerShell.cs index 13603e095469..63c699de3f38 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Sku.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Sku partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.ISku DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Sku(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.VMware.Models.Api20211201.ISku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Sku(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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. @@ -111,13 +111,13 @@ internal Sku(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)this).Name, 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,7 +132,7 @@ internal Sku(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Sku.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Sku.TypeConverter.cs index 81b1659e821e..b02898858b43 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Sku.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ISku ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.cs b/src/VMware/VMware.Autorest/generated/api/Models/Sku.cs similarity index 86% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Sku.cs index f989b46cd815..5d656aff6b55 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Sku.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The resource model definition representing SKU public partial class Sku : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISkuInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISkuInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface ISku : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the SKU.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Sku.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Sku.json.cs index 4c7d9a00f182..c8f58db654e2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Sku.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Sku.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Sku partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ISku FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Sku(json) : null; } @@ -77,7 +75,7 @@ internal Sku(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject j { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.PowerShell.cs similarity index 72% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.PowerShell.cs index f19136e3fb8a..7e4213088a16 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TrackedResource partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrackedResource(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.VMware.Models.Api20211201.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrackedResource(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrac /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,29 +128,29 @@ internal TrackedResource(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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. @@ -165,23 +165,23 @@ internal TrackedResource(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTagsTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs index a5dab6466238..cc6d62f02de7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ITrackedResource ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.cs b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.cs rename to src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.cs index d0ebb6e37859..6cf3e7e6105a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.cs @@ -3,25 +3,24 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// The resource model definition for a ARM tracked top level resource public partial class TrackedResource : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResourceInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(); /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; } /// Backing field for property. private string _location; @@ -31,28 +30,28 @@ public partial class TrackedResource : public string Location { get => this._location; set => this._location = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags _tag; /// Resource tags [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags()); set => this._tag = value; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__resource).Type; } /// Creates an new instance. public TrackedResource() @@ -75,12 +74,15 @@ public TrackedResource() /// The resource model definition for a ARM tracked top level resource public partial interface ITrackedResource : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResource { /// Resource location [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource location", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -89,20 +91,23 @@ public partial interface ITrackedResource : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get; set; } } /// The resource model definition for a ARM tracked top level resource internal partial interface ITrackedResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal { /// Resource location string Location { get; set; } /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.json.cs index 9658a8367cef..2411e3cdbfa4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/TrackedResource.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/TrackedResource.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrackedResource partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; } @@ -103,9 +103,9 @@ internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json. { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ResourceTags.FromJson(__jsonTags) : Tag;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Resource(json); + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ResourceTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/Trial.PowerShell.cs similarity index 80% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Trial.PowerShell.cs index 7438776baf4a..8c12e5624c20 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Trial.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class Trial partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.ITrial DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Trial(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.VMware.Models.Api20211201.ITrial DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Trial(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITria /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal Trial(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("AvailableHost")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).AvailableHost = (int?) content.GetValueForProperty("AvailableHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).AvailableHost, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).AvailableHost = (int?) content.GetValueForProperty("AvailableHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).AvailableHost, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } 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. @@ -153,11 +153,11 @@ internal Trial(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("AvailableHost")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).AvailableHost = (int?) content.GetValueForProperty("AvailableHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal)this).AvailableHost, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).AvailableHost = (int?) content.GetValueForProperty("AvailableHost",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal)this).AvailableHost, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/Trial.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Trial.TypeConverter.cs index 65a835902d12..c451a42f7ef9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Trial.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ITrial ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.cs b/src/VMware/VMware.Autorest/generated/api/Models/Trial.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Trial.cs index 9beea07b6bd7..fd2ec60cf65e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Trial.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Subscription trial availability public partial class Trial : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal { /// Backing field for property. @@ -21,17 +21,17 @@ public partial class Trial : public int? AvailableHost { get => this._availableHost; } /// Internal Acessors for AvailableHost - int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal.AvailableHost { get => this._availableHost; set { {_availableHost = value;} } } + int? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal.AvailableHost { get => this._availableHost; set { {_availableHost = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrialInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrialInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus? _status; + private string _status; /// Trial status [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public Trial() @@ -47,6 +47,9 @@ public partial interface ITrial : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Number of trial hosts available", SerializedName = @"availableHosts", PossibleTypes = new [] { typeof(int) })] @@ -55,10 +58,14 @@ public partial interface ITrial : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Trial status", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("TrialAvailable", "TrialUsed", "TrialDisabled")] + string Status { get; } } /// Subscription trial availability @@ -68,7 +75,8 @@ internal partial interface ITrialInternal /// Number of trial hosts available int? AvailableHost { get; set; } /// Trial status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("TrialAvailable", "TrialUsed", "TrialDisabled")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/Trial.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/Trial.json.cs index eb14f6c711bc..7350c17df1f5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/Trial.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/Trial.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class Trial partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial. + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new Trial(json) : null; } @@ -84,11 +82,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._availableHost ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNumber((int)this._availableHost) : null, "availableHosts" ,container.Add ); } @@ -108,8 +106,8 @@ internal Trial(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject { return; } - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_availableHost = If( json?.PropertyT("availableHosts"), out var __jsonAvailableHosts) ? (int?)__jsonAvailableHosts : AvailableHost;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_availableHost = If( json?.PropertyT("availableHosts"), out var __jsonAvailableHosts) ? (int?)__jsonAvailableHosts : _availableHost;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.PowerShell.cs similarity index 60% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.PowerShell.cs index 939cff307f23..a66370d7bde6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class VMHostPlacementPolicyProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VMHostPlacementPolicyProperties(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.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VMHostPlacementPolicyProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHo /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,37 +128,45 @@ internal VMHostPlacementPolicyProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("HostMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).HostMember = (string[]) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).HostMember = (System.Collections.Generic.List) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AffinityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType = (string) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType, global::System.Convert.ToString); + } + if (content.Contains("AffinityStrength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityStrength = (string) content.GetValueForProperty("AffinityStrength",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityStrength, global::System.Convert.ToString); + } + if (content.Contains("AzureHybridBenefitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AzureHybridBenefitType = (string) content.GetValueForProperty("AzureHybridBenefitType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AzureHybridBenefitType, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState, 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. @@ -175,31 +181,39 @@ internal VMHostPlacementPolicyProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("HostMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).HostMember = (string[]) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).HostMember = (System.Collections.Generic.List) content.GetValueForProperty("HostMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).HostMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AffinityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType = (string) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityType, global::System.Convert.ToString); + } + if (content.Contains("AffinityStrength")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityStrength = (string) content.GetValueForProperty("AffinityStrength",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AffinityStrength, global::System.Convert.ToString); + } + if (content.Contains("AzureHybridBenefitType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AzureHybridBenefitType = (string) content.GetValueForProperty("AzureHybridBenefitType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal)this).AzureHybridBenefitType, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.TypeConverter.cs index d099753c6b0c..91317e8aee60 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.cs new file mode 100644 index 000000000000..17f6b651a418 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.cs @@ -0,0 +1,179 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// VM-Host placement policy properties + public partial class VMHostPlacementPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties(); + + /// Backing field for property. + private string _affinityStrength; + + /// vm-host placement policy affinity strength (should/must) + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string AffinityStrength { get => this._affinityStrength; set => this._affinityStrength = value; } + + /// Backing field for property. + private string _affinityType; + + /// placement policy affinity type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string AffinityType { get => this._affinityType; set => this._affinityType = value; } + + /// Backing field for property. + private string _azureHybridBenefitType; + + /// placement policy azure hybrid benefit opt-in type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string AzureHybridBenefitType { get => this._azureHybridBenefitType; set => this._azureHybridBenefitType = value; } + + /// Display name of the placement policy + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName = value ?? null; } + + /// Backing field for property. + private System.Collections.Generic.List _hostMember; + + /// Host members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List HostMember { get => this._hostMember; set => this._hostMember = value; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState = value; } + + /// The provisioning state + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; } + + /// Whether the placement policy is enabled or disabled + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State = value ?? null; } + + /// placement policy type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string Type { get => "VmHost"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).Type = "VmHost"; } + + /// Backing field for property. + private System.Collections.Generic.List _vMMember; + + /// Virtual machine members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List VMMember { get => this._vMMember; set => this._vMMember = value; } + + /// Creates an new instance. + public VMHostPlacementPolicyProperties() + { + this.__placementPolicyProperties.Type = "VmHost"; + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__placementPolicyProperties), __placementPolicyProperties); + await eventListener.AssertObjectIsValid(nameof(__placementPolicyProperties), __placementPolicyProperties); + } + } + /// VM-Host placement policy properties + public partial interface IVMHostPlacementPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties + { + /// vm-host placement policy affinity strength (should/must) + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + string AffinityStrength { get; set; } + /// placement policy affinity type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"placement policy affinity type", + SerializedName = @"affinityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + string AffinityType { get; set; } + /// placement policy azure hybrid benefit opt-in type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + string AzureHybridBenefitType { get; set; } + /// Host members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Host members list", + SerializedName = @"hostMembers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HostMember { get; set; } + /// Virtual machine members list + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Virtual machine members list", + SerializedName = @"vmMembers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VMMember { get; set; } + + } + /// VM-Host placement policy properties + internal partial interface IVMHostPlacementPolicyPropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal + { + /// vm-host placement policy affinity strength (should/must) + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + string AffinityStrength { get; set; } + /// placement policy affinity type + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + string AffinityType { get; set; } + /// placement policy azure hybrid benefit opt-in type + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + string AzureHybridBenefitType { get; set; } + /// Host members list + System.Collections.Generic.List HostMember { get; set; } + /// Virtual machine members list + System.Collections.Generic.List VMMember { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.json.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.json.cs index 46a67c00dc2d..bda1bac7aac0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMHostPlacementPolicyProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMHostPlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VMHostPlacementPolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMHostPlacementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMHostPlacementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new VMHostPlacementPolicyProperties(json) : null; } @@ -104,6 +104,8 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("hostMembers",__r); } AddIf( null != (((object)this._affinityType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._affinityType.ToString()) : null, "affinityType" ,container.Add ); + AddIf( null != (((object)this._affinityStrength)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._affinityStrength.ToString()) : null, "affinityStrength" ,container.Add ); + AddIf( null != (((object)this._azureHybridBenefitType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._azureHybridBenefitType.ToString()) : null, "azureHybridBenefitType" ,container.Add ); AfterToJson(ref container); return container; } @@ -120,10 +122,12 @@ internal VMHostPlacementPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.VMwa { return; } - __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties(json); - {_vMMember = If( json?.PropertyT("vmMembers"), out var __jsonVMMembers) ? If( __jsonVMMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : VMMember;} - {_hostMember = If( json?.PropertyT("hostMembers"), out var __jsonHostMembers) ? If( __jsonHostMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : HostMember;} - {_affinityType = If( json?.PropertyT("affinityType"), out var __jsonAffinityType) ? (string)__jsonAffinityType : (string)AffinityType;} + __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties(json); + {_vMMember = If( json?.PropertyT("vmMembers"), out var __jsonVMMembers) ? If( __jsonVMMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _vMMember;} + {_hostMember = If( json?.PropertyT("hostMembers"), out var __jsonHostMembers) ? If( __jsonHostMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _hostMember;} + {_affinityType = If( json?.PropertyT("affinityType"), out var __jsonAffinityType) ? (string)__jsonAffinityType : (string)_affinityType;} + {_affinityStrength = If( json?.PropertyT("affinityStrength"), out var __jsonAffinityStrength) ? (string)__jsonAffinityStrength : (string)_affinityStrength;} + {_azureHybridBenefitType = If( json?.PropertyT("azureHybridBenefitType"), out var __jsonAzureHybridBenefitType) ? (string)__jsonAzureHybridBenefitType : (string)_azureHybridBenefitType;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.PowerShell.cs similarity index 64% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.PowerShell.cs index 03f08390fc09..f80c14405e20 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class VMPlacementPolicyProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IVMPlacementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VMPlacementPolicyProperties(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.VMware.Models.Api20211201.IVMPlacementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VMPlacementPolicyProperties(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPl /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,33 +128,33 @@ internal VMPlacementPolicyProperties(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AffinityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).AffinityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).AffinityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).AffinityType = (string) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).AffinityType, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState, 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. @@ -169,27 +169,27 @@ internal VMPlacementPolicyProperties(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("VMMember")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).VMMember = (string[]) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).VMMember = (System.Collections.Generic.List) content.GetValueForProperty("VMMember",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).VMMember, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AffinityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).AffinityType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal)this).AffinityType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).AffinityType = (string) content.GetValueForProperty("AffinityType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal)this).AffinityType, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.TypeConverter.cs index e11c229c5d2e..280182cdba0b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVMPlacementPolicyProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.cs similarity index 55% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.cs index 8b2b188739ce..1d3ed5f31168 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.cs @@ -3,59 +3,60 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// VM-VM placement policy properties public partial class VMPlacementPolicyProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyPropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyPropertiesInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties(); /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType _affinityType; + private string _affinityType; /// placement policy affinity type [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AffinityType { get => this._affinityType; set => this._affinityType = value; } + public string AffinityType { get => this._affinityType; set => this._affinityType = value; } /// Display name of the placement policy [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).DisplayName = value ?? null; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).ProvisioningState; } /// Whether the placement policy is enabled or disabled [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState)""); } + public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).State = value ?? null; } /// placement policy type + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).Type = value ; } + public string Type { get => "VmVm"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal)__placementPolicyProperties).Type = "VmVm"; } /// Backing field for property. - private string[] _vMMember; + private System.Collections.Generic.List _vMMember; /// Virtual machine members list [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] VMMember { get => this._vMMember; set => this._vMMember = value; } + public System.Collections.Generic.List VMMember { get => this._vMMember; set => this._vMMember = value; } /// Creates an new instance. public VMPlacementPolicyProperties() { - + this.__placementPolicyProperties.Type = "VmVm"; } /// Validates that this object meets the validation criteria. @@ -73,34 +74,42 @@ public VMPlacementPolicyProperties() /// VM-VM placement policy properties public partial interface IVMPlacementPolicyProperties : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties { /// placement policy affinity type [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"placement policy affinity type", SerializedName = @"affinityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AffinityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + string AffinityType { get; set; } /// Virtual machine members list [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Virtual machine members list", SerializedName = @"vmMembers", PossibleTypes = new [] { typeof(string) })] - string[] VMMember { get; set; } + System.Collections.Generic.List VMMember { get; set; } } /// VM-VM placement policy properties internal partial interface IVMPlacementPolicyPropertiesInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyPropertiesInternal { /// placement policy affinity type - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AffinityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + string AffinityType { get; set; } /// Virtual machine members list - string[] VMMember { get; set; } + System.Collections.Generic.List VMMember { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.json.cs index 44965f2a20f7..6f14cba48b09 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VMPlacementPolicyProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMPlacementPolicyProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VMPlacementPolicyProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVMPlacementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMPlacementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new VMPlacementPolicyProperties(json) : null; } @@ -111,9 +111,9 @@ internal VMPlacementPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.R { return; } - __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyProperties(json); - {_vMMember = If( json?.PropertyT("vmMembers"), out var __jsonVMMembers) ? If( __jsonVMMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : VMMember;} - {_affinityType = If( json?.PropertyT("affinityType"), out var __jsonAffinityType) ? (string)__jsonAffinityType : (string)AffinityType;} + __placementPolicyProperties = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyProperties(json); + {_vMMember = If( json?.PropertyT("vmMembers"), out var __jsonVMMembers) ? If( __jsonVMMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _vMMember;} + {_affinityType = If( json?.PropertyT("affinityType"), out var __jsonAffinityType) ? (string)__jsonAffinityType : (string)_affinityType;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.PowerShell.cs index a45c44a92a2f..421760105ce3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.PowerShell.cs @@ -161,6 +161,10 @@ internal VMwareIdentity(global::System.Collections.IDictionary content) { ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).GlobalReachConnectionName = (string) content.GetValueForProperty("GlobalReachConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).GlobalReachConnectionName, global::System.Convert.ToString); } + if (content.Contains("WorkloadNetworkName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).WorkloadNetworkName = (string) content.GetValueForProperty("WorkloadNetworkName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).WorkloadNetworkName, global::System.Convert.ToString); + } if (content.Contains("SegmentId")) { ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).SegmentId = (string) content.GetValueForProperty("SegmentId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).SegmentId, global::System.Convert.ToString); @@ -278,6 +282,10 @@ internal VMwareIdentity(global::System.Management.Automation.PSObject content) { ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).GlobalReachConnectionName = (string) content.GetValueForProperty("GlobalReachConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).GlobalReachConnectionName, global::System.Convert.ToString); } + if (content.Contains("WorkloadNetworkName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).WorkloadNetworkName = (string) content.GetValueForProperty("WorkloadNetworkName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).WorkloadNetworkName, global::System.Convert.ToString); + } if (content.Contains("SegmentId")) { ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).SegmentId = (string) content.GetValueForProperty("SegmentId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentityInternal)this).SegmentId, global::System.Convert.ToString); diff --git a/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.cs index 45b6ed766b30..8f42cec29360 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.cs @@ -195,6 +195,13 @@ public partial class VMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = value; } + /// Backing field for property. + private string _workloadNetworkName; + + /// Name for the workload network in the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string WorkloadNetworkName { get => this._workloadNetworkName; set => this._workloadNetworkName = value; } + /// Creates an new instance. public VMwareIdentity() { @@ -208,6 +215,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the addon for the private cloud", SerializedName = @"addonName", PossibleTypes = new [] { typeof(string) })] @@ -216,6 +226,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the ExpressRoute Circuit Authorization in the private cloud", SerializedName = @"authorizationName", PossibleTypes = new [] { typeof(string) })] @@ -224,6 +237,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the cloud link resource", SerializedName = @"cloudLinkName", PossibleTypes = new [] { typeof(string) })] @@ -232,6 +248,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the cluster in the private cloud", SerializedName = @"clusterName", PossibleTypes = new [] { typeof(string) })] @@ -240,6 +259,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the datastore in the private cloud cluster", SerializedName = @"datastoreName", PossibleTypes = new [] { typeof(string) })] @@ -248,6 +270,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX DHCP identifier. Generally the same as the DHCP display name", SerializedName = @"dhcpId", PossibleTypes = new [] { typeof(string) })] @@ -258,6 +283,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX DNS Service identifier. Generally the same as the DNS Service's display name", SerializedName = @"dnsServiceId", PossibleTypes = new [] { typeof(string) })] @@ -266,6 +294,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX DNS Zone identifier. Generally the same as the DNS Zone's display name", SerializedName = @"dnsZoneId", PossibleTypes = new [] { typeof(string) })] @@ -274,6 +305,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX Gateway identifier. Generally the same as the Gateway's display name", SerializedName = @"gatewayId", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +316,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the global reach connection in the private cloud", SerializedName = @"globalReachConnectionName", PossibleTypes = new [] { typeof(string) })] @@ -290,6 +327,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the HCX Enterprise Site in the private cloud", SerializedName = @"hcxEnterpriseSiteName", PossibleTypes = new [] { typeof(string) })] @@ -298,6 +338,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +349,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Azure region", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -316,6 +362,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", SerializedName = @"placementPolicyName", PossibleTypes = new [] { typeof(string) })] @@ -326,6 +375,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name", SerializedName = @"portMirroringId", PossibleTypes = new [] { typeof(string) })] @@ -334,6 +386,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the private cloud", SerializedName = @"privateCloudName", PossibleTypes = new [] { typeof(string) })] @@ -344,6 +399,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX Public IP Block identifier. Generally the same as the Public IP Block's display name", SerializedName = @"publicIPId", PossibleTypes = new [] { typeof(string) })] @@ -352,6 +410,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource group. The name is case insensitive.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -360,6 +421,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the script cmdlet resource in the script package in the private cloud", SerializedName = @"scriptCmdletName", PossibleTypes = new [] { typeof(string) })] @@ -368,6 +432,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the user-invoked script execution resource", SerializedName = @"scriptExecutionName", PossibleTypes = new [] { typeof(string) })] @@ -376,6 +443,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the script package in the private cloud", SerializedName = @"scriptPackageName", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +454,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX Segment identifier. Generally the same as the Segment's display name", SerializedName = @"segmentId", PossibleTypes = new [] { typeof(string) })] @@ -392,6 +465,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the target subscription.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -400,6 +476,9 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX VM Group identifier. Generally the same as the VM Group's display name", SerializedName = @"vmGroupId", PossibleTypes = new [] { typeof(string) })] @@ -408,10 +487,25 @@ public partial interface IVMwareIdentity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Virtual Machine identifier", SerializedName = @"virtualMachineId", PossibleTypes = new [] { typeof(string) })] string VirtualMachineId { get; set; } + /// Name for the workload network in the private cloud + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Name for the workload network in the private cloud", + SerializedName = @"workloadNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("default")] + string WorkloadNetworkName { get; set; } } internal partial interface IVMwareIdentityInternal @@ -475,6 +569,9 @@ internal partial interface IVMwareIdentityInternal string VMGroupId { get; set; } /// Virtual Machine identifier string VirtualMachineId { get; set; } + /// Name for the workload network in the private cloud + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("default")] + string WorkloadNetworkName { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.json.cs index 3755975283ed..56c188a3047f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VMwareIdentity.json.cs @@ -92,6 +92,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi AddIf( null != (((object)this._hcxEnterpriseSiteName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._hcxEnterpriseSiteName.ToString()) : null, "hcxEnterpriseSiteName" ,container.Add ); AddIf( null != (((object)this._authorizationName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._authorizationName.ToString()) : null, "authorizationName" ,container.Add ); AddIf( null != (((object)this._globalReachConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._globalReachConnectionName.ToString()) : null, "globalReachConnectionName" ,container.Add ); + AddIf( null != (((object)this._workloadNetworkName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._workloadNetworkName.ToString()) : null, "workloadNetworkName" ,container.Add ); AddIf( null != (((object)this._segmentId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._segmentId.ToString()) : null, "segmentId" ,container.Add ); AddIf( null != (((object)this._dhcpId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._dhcpId.ToString()) : null, "dhcpId" ,container.Add ); AddIf( null != (((object)this._gatewayId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._gatewayId.ToString()) : null, "gatewayId" ,container.Add ); @@ -124,31 +125,32 @@ internal VMwareIdentity(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.J { return; } - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_privateCloudName = If( json?.PropertyT("privateCloudName"), out var __jsonPrivateCloudName) ? (string)__jsonPrivateCloudName : (string)PrivateCloudName;} - {_clusterName = If( json?.PropertyT("clusterName"), out var __jsonClusterName) ? (string)__jsonClusterName : (string)ClusterName;} - {_datastoreName = If( json?.PropertyT("datastoreName"), out var __jsonDatastoreName) ? (string)__jsonDatastoreName : (string)DatastoreName;} - {_hcxEnterpriseSiteName = If( json?.PropertyT("hcxEnterpriseSiteName"), out var __jsonHcxEnterpriseSiteName) ? (string)__jsonHcxEnterpriseSiteName : (string)HcxEnterpriseSiteName;} - {_authorizationName = If( json?.PropertyT("authorizationName"), out var __jsonAuthorizationName) ? (string)__jsonAuthorizationName : (string)AuthorizationName;} - {_globalReachConnectionName = If( json?.PropertyT("globalReachConnectionName"), out var __jsonGlobalReachConnectionName) ? (string)__jsonGlobalReachConnectionName : (string)GlobalReachConnectionName;} - {_segmentId = If( json?.PropertyT("segmentId"), out var __jsonSegmentId) ? (string)__jsonSegmentId : (string)SegmentId;} - {_dhcpId = If( json?.PropertyT("dhcpId"), out var __jsonDhcpId) ? (string)__jsonDhcpId : (string)DhcpId;} - {_gatewayId = If( json?.PropertyT("gatewayId"), out var __jsonGatewayId) ? (string)__jsonGatewayId : (string)GatewayId;} - {_portMirroringId = If( json?.PropertyT("portMirroringId"), out var __jsonPortMirroringId) ? (string)__jsonPortMirroringId : (string)PortMirroringId;} - {_vMGroupId = If( json?.PropertyT("vmGroupId"), out var __jsonVMGroupId) ? (string)__jsonVMGroupId : (string)VMGroupId;} - {_virtualMachineId = If( json?.PropertyT("virtualMachineId"), out var __jsonVirtualMachineId) ? (string)__jsonVirtualMachineId : (string)VirtualMachineId;} - {_dnsServiceId = If( json?.PropertyT("dnsServiceId"), out var __jsonDnsServiceId) ? (string)__jsonDnsServiceId : (string)DnsServiceId;} - {_dnsZoneId = If( json?.PropertyT("dnsZoneId"), out var __jsonDnsZoneId) ? (string)__jsonDnsZoneId : (string)DnsZoneId;} - {_publicIPId = If( json?.PropertyT("publicIPId"), out var __jsonPublicIPId) ? (string)__jsonPublicIPId : (string)PublicIPId;} - {_cloudLinkName = If( json?.PropertyT("cloudLinkName"), out var __jsonCloudLinkName) ? (string)__jsonCloudLinkName : (string)CloudLinkName;} - {_addonName = If( json?.PropertyT("addonName"), out var __jsonAddonName) ? (string)__jsonAddonName : (string)AddonName;} - {_placementPolicyName = If( json?.PropertyT("placementPolicyName"), out var __jsonPlacementPolicyName) ? (string)__jsonPlacementPolicyName : (string)PlacementPolicyName;} - {_scriptPackageName = If( json?.PropertyT("scriptPackageName"), out var __jsonScriptPackageName) ? (string)__jsonScriptPackageName : (string)ScriptPackageName;} - {_scriptCmdletName = If( json?.PropertyT("scriptCmdletName"), out var __jsonScriptCmdletName) ? (string)__jsonScriptCmdletName : (string)ScriptCmdletName;} - {_scriptExecutionName = If( json?.PropertyT("scriptExecutionName"), out var __jsonScriptExecutionName) ? (string)__jsonScriptExecutionName : (string)ScriptExecutionName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_privateCloudName = If( json?.PropertyT("privateCloudName"), out var __jsonPrivateCloudName) ? (string)__jsonPrivateCloudName : (string)_privateCloudName;} + {_clusterName = If( json?.PropertyT("clusterName"), out var __jsonClusterName) ? (string)__jsonClusterName : (string)_clusterName;} + {_datastoreName = If( json?.PropertyT("datastoreName"), out var __jsonDatastoreName) ? (string)__jsonDatastoreName : (string)_datastoreName;} + {_hcxEnterpriseSiteName = If( json?.PropertyT("hcxEnterpriseSiteName"), out var __jsonHcxEnterpriseSiteName) ? (string)__jsonHcxEnterpriseSiteName : (string)_hcxEnterpriseSiteName;} + {_authorizationName = If( json?.PropertyT("authorizationName"), out var __jsonAuthorizationName) ? (string)__jsonAuthorizationName : (string)_authorizationName;} + {_globalReachConnectionName = If( json?.PropertyT("globalReachConnectionName"), out var __jsonGlobalReachConnectionName) ? (string)__jsonGlobalReachConnectionName : (string)_globalReachConnectionName;} + {_workloadNetworkName = If( json?.PropertyT("workloadNetworkName"), out var __jsonWorkloadNetworkName) ? (string)__jsonWorkloadNetworkName : (string)_workloadNetworkName;} + {_segmentId = If( json?.PropertyT("segmentId"), out var __jsonSegmentId) ? (string)__jsonSegmentId : (string)_segmentId;} + {_dhcpId = If( json?.PropertyT("dhcpId"), out var __jsonDhcpId) ? (string)__jsonDhcpId : (string)_dhcpId;} + {_gatewayId = If( json?.PropertyT("gatewayId"), out var __jsonGatewayId) ? (string)__jsonGatewayId : (string)_gatewayId;} + {_portMirroringId = If( json?.PropertyT("portMirroringId"), out var __jsonPortMirroringId) ? (string)__jsonPortMirroringId : (string)_portMirroringId;} + {_vMGroupId = If( json?.PropertyT("vmGroupId"), out var __jsonVMGroupId) ? (string)__jsonVMGroupId : (string)_vMGroupId;} + {_virtualMachineId = If( json?.PropertyT("virtualMachineId"), out var __jsonVirtualMachineId) ? (string)__jsonVirtualMachineId : (string)_virtualMachineId;} + {_dnsServiceId = If( json?.PropertyT("dnsServiceId"), out var __jsonDnsServiceId) ? (string)__jsonDnsServiceId : (string)_dnsServiceId;} + {_dnsZoneId = If( json?.PropertyT("dnsZoneId"), out var __jsonDnsZoneId) ? (string)__jsonDnsZoneId : (string)_dnsZoneId;} + {_publicIPId = If( json?.PropertyT("publicIPId"), out var __jsonPublicIPId) ? (string)__jsonPublicIPId : (string)_publicIPId;} + {_cloudLinkName = If( json?.PropertyT("cloudLinkName"), out var __jsonCloudLinkName) ? (string)__jsonCloudLinkName : (string)_cloudLinkName;} + {_addonName = If( json?.PropertyT("addonName"), out var __jsonAddonName) ? (string)__jsonAddonName : (string)_addonName;} + {_placementPolicyName = If( json?.PropertyT("placementPolicyName"), out var __jsonPlacementPolicyName) ? (string)__jsonPlacementPolicyName : (string)_placementPolicyName;} + {_scriptPackageName = If( json?.PropertyT("scriptPackageName"), out var __jsonScriptPackageName) ? (string)__jsonScriptPackageName : (string)_scriptPackageName;} + {_scriptCmdletName = If( json?.PropertyT("scriptCmdletName"), out var __jsonScriptCmdletName) ? (string)__jsonScriptCmdletName : (string)_scriptCmdletName;} + {_scriptExecutionName = If( json?.PropertyT("scriptExecutionName"), out var __jsonScriptExecutionName) ? (string)__jsonScriptExecutionName : (string)_scriptExecutionName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.PowerShell.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.PowerShell.cs index cd46a3f72688..9ecc844737fb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class VirtualMachine partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IVirtualMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachine(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.VMware.Models.Api20211201.IVirtualMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachine(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirt /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,41 +128,41 @@ internal VirtualMachine(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachinePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachinePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("MoRefId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).MoRefId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).MoRefId, global::System.Convert.ToString); } if (content.Contains("FolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).FolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).FolderPath, global::System.Convert.ToString); } if (content.Contains("RestrictMovement")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).RestrictMovement = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState?) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).RestrictMovement, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).RestrictMovement = (string) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).RestrictMovement, 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. @@ -177,35 +177,35 @@ internal VirtualMachine(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachinePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachinePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("MoRefId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).MoRefId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).MoRefId, global::System.Convert.ToString); } if (content.Contains("FolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).FolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).FolderPath, global::System.Convert.ToString); } if (content.Contains("RestrictMovement")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).RestrictMovement = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState?) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal)this).RestrictMovement, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).RestrictMovement = (string) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal)this).RestrictMovement, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.TypeConverter.cs index e3692ce2d803..7c8f9b417051 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachine ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.cs index 3084ecec6a22..278f036aa095 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.cs @@ -3,74 +3,73 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Virtual Machine public partial class VirtualMachine : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Display name of the VM. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).DisplayName; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).DisplayName; } /// /// Path to virtual machine's folder starting from datacenter virtual machine folder /// [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string FolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).FolderPath; } + public string FolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).FolderPath; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for DisplayName - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal.DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).DisplayName = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal.DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).DisplayName = value; } /// Internal Acessors for FolderPath - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal.FolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).FolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).FolderPath = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal.FolderPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).FolderPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).FolderPath = value; } /// Internal Acessors for MoRefId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal.MoRefId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).MoRefId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).MoRefId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal.MoRefId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).MoRefId; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).MoRefId = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineProperties()); set { {_property = value;} } } /// Internal Acessors for RestrictMovement - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineInternal.RestrictMovement { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).RestrictMovement; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).RestrictMovement = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineInternal.RestrictMovement { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).RestrictMovement; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).RestrictMovement = value; } /// Virtual machine managed object reference id [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string MoRefId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).MoRefId; } + public string MoRefId { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).MoRefId; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties _property; /// Virtual machine properties. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -78,11 +77,11 @@ public partial class VirtualMachine : /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)Property).RestrictMovement; } + public string RestrictMovement { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)Property).RestrictMovement; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -92,8 +91,8 @@ public partial class VirtualMachine : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -105,12 +104,15 @@ public VirtualMachine() /// Virtual Machine public partial interface IVirtualMachine : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Display name of the VM. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the VM.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +123,9 @@ public partial interface IVirtualMachine : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Path to virtual machine's folder starting from datacenter virtual machine folder", SerializedName = @"folderPath", PossibleTypes = new [] { typeof(string) })] @@ -129,6 +134,9 @@ public partial interface IVirtualMachine : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Virtual machine managed object reference id", SerializedName = @"moRefId", PossibleTypes = new [] { typeof(string) })] @@ -137,15 +145,19 @@ public partial interface IVirtualMachine : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", SerializedName = @"restrictMovement", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string RestrictMovement { get; } } /// Virtual Machine internal partial interface IVirtualMachineInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Display name of the VM. string DisplayName { get; set; } @@ -156,9 +168,10 @@ internal partial interface IVirtualMachineInternal : /// Virtual machine managed object reference id string MoRefId { get; set; } /// Virtual machine properties. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties Property { get; set; } /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string RestrictMovement { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.json.cs index be149d5b67be..e832c655ce26 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachine.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachine.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachine partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new VirtualMachine(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal VirtualMachine(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.J { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.PowerShell.cs similarity index 72% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.PowerShell.cs index a2ed05606464..502650194d25 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class VirtualMachineProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IVirtualMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachineProperties(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.VMware.Models.Api20211201.IVirtualMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachineProperties(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirt /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,25 +128,25 @@ internal VirtualMachineProperties(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("MoRefId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).MoRefId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).MoRefId, global::System.Convert.ToString); } if (content.Contains("FolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).FolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).FolderPath, global::System.Convert.ToString); } if (content.Contains("RestrictMovement")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).RestrictMovement = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState?) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).RestrictMovement, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).RestrictMovement = (string) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).RestrictMovement, 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. @@ -161,19 +161,19 @@ internal VirtualMachineProperties(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("MoRefId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).MoRefId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).MoRefId = (string) content.GetValueForProperty("MoRefId",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).MoRefId, global::System.Convert.ToString); } if (content.Contains("FolderPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).FolderPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).FolderPath = (string) content.GetValueForProperty("FolderPath",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).FolderPath, global::System.Convert.ToString); } if (content.Contains("RestrictMovement")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).RestrictMovement = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState?) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal)this).RestrictMovement, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).RestrictMovement = (string) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal)this).RestrictMovement, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.TypeConverter.cs index 2ce649acd005..b68f10032307 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachineProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.cs index bee70f396ba3..f2af87599b1e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Virtual Machine Properties public partial class VirtualMachineProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal { /// Backing field for property. @@ -30,16 +30,16 @@ public partial class VirtualMachineProperties : public string FolderPath { get => this._folderPath; } /// Internal Acessors for DisplayName - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal.DisplayName { get => this._displayName; set { {_displayName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal.DisplayName { get => this._displayName; set { {_displayName = value;} } } /// Internal Acessors for FolderPath - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal.FolderPath { get => this._folderPath; set { {_folderPath = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal.FolderPath { get => this._folderPath; set { {_folderPath = value;} } } /// Internal Acessors for MoRefId - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal.MoRefId { get => this._moRefId; set { {_moRefId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal.MoRefId { get => this._moRefId; set { {_moRefId = value;} } } /// Internal Acessors for RestrictMovement - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinePropertiesInternal.RestrictMovement { get => this._restrictMovement; set { {_restrictMovement = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinePropertiesInternal.RestrictMovement { get => this._restrictMovement; set { {_restrictMovement = value;} } } /// Backing field for property. private string _moRefId; @@ -49,11 +49,11 @@ public partial class VirtualMachineProperties : public string MoRefId { get => this._moRefId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? _restrictMovement; + private string _restrictMovement; /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get => this._restrictMovement; } + public string RestrictMovement { get => this._restrictMovement; } /// Creates an new instance. public VirtualMachineProperties() @@ -69,6 +69,9 @@ public partial interface IVirtualMachineProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Display name of the VM.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +82,9 @@ public partial interface IVirtualMachineProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Path to virtual machine's folder starting from datacenter virtual machine folder", SerializedName = @"folderPath", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +93,9 @@ public partial interface IVirtualMachineProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Virtual machine managed object reference id", SerializedName = @"moRefId", PossibleTypes = new [] { typeof(string) })] @@ -95,10 +104,14 @@ public partial interface IVirtualMachineProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", SerializedName = @"restrictMovement", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string RestrictMovement { get; } } /// Virtual Machine Properties @@ -114,7 +127,8 @@ internal partial interface IVirtualMachinePropertiesInternal /// Virtual machine managed object reference id string MoRefId { get; set; } /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string RestrictMovement { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.json.cs similarity index 92% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.json.cs index a05044df049a..b7ea4650d38c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachineProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new VirtualMachineProperties(json) : null; } @@ -84,19 +84,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._moRefId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._moRefId.ToString()) : null, "moRefId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._folderPath)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._folderPath.ToString()) : null, "folderPath" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._restrictMovement)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._restrictMovement.ToString()) : null, "restrictMovement" ,container.Add ); } @@ -116,10 +116,10 @@ internal VirtualMachineProperties(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runt { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_moRefId = If( json?.PropertyT("moRefId"), out var __jsonMoRefId) ? (string)__jsonMoRefId : (string)MoRefId;} - {_folderPath = If( json?.PropertyT("folderPath"), out var __jsonFolderPath) ? (string)__jsonFolderPath : (string)FolderPath;} - {_restrictMovement = If( json?.PropertyT("restrictMovement"), out var __jsonRestrictMovement) ? (string)__jsonRestrictMovement : (string)RestrictMovement;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_moRefId = If( json?.PropertyT("moRefId"), out var __jsonMoRefId) ? (string)__jsonMoRefId : (string)_moRefId;} + {_folderPath = If( json?.PropertyT("folderPath"), out var __jsonFolderPath) ? (string)__jsonFolderPath : (string)_folderPath;} + {_restrictMovement = If( json?.PropertyT("restrictMovement"), out var __jsonRestrictMovement) ? (string)__jsonRestrictMovement : (string)_restrictMovement;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.PowerShell.cs similarity index 81% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.PowerShell.cs index 589f1526e98e..2cf89b093b5f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class VirtualMachineRestrictMovement partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IVirtualMachineRestrictMovement DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachineRestrictMovement(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.VMware.Models.Api20211201.IVirtualMachineRestrictMovement DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachineRestrictMovement(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirt /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,13 +128,13 @@ internal VirtualMachineRestrictMovement(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("RestrictMovement")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovementInternal)this).RestrictMovement = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState?) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovementInternal)this).RestrictMovement, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovementInternal)this).RestrictMovement = (string) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovementInternal)this).RestrictMovement, 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. @@ -151,7 +149,7 @@ internal VirtualMachineRestrictMovement(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("RestrictMovement")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovementInternal)this).RestrictMovement = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState?) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovementInternal)this).RestrictMovement, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovementInternal)this).RestrictMovement = (string) content.GetValueForProperty("RestrictMovement",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovementInternal)this).RestrictMovement, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.TypeConverter.cs index c01019434f9e..4387b43c1060 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.cs index 0fa127b282ad..cf64bf993e63 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) public partial class VirtualMachineRestrictMovement : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovementInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovementInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? _restrictMovement; + private string _restrictMovement; /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get => this._restrictMovement; set => this._restrictMovement = value; } + public string RestrictMovement { get => this._restrictMovement; set => this._restrictMovement = value; } /// Creates an new instance. public VirtualMachineRestrictMovement() @@ -34,10 +34,14 @@ public partial interface IVirtualMachineRestrictMovement : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", SerializedName = @"restrictMovement", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string RestrictMovement { get; set; } } /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) @@ -45,7 +49,8 @@ internal partial interface IVirtualMachineRestrictMovementInternal { /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState? RestrictMovement { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string RestrictMovement { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.json.cs index 276dca70ec0e..145ac071dac5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachineRestrictMovement.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachineRestrictMovement.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachineRestrictMovement partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new VirtualMachineRestrictMovement(json) : null; } @@ -101,7 +101,7 @@ internal VirtualMachineRestrictMovement(Microsoft.Azure.PowerShell.Cmdlets.VMwar { return; } - {_restrictMovement = If( json?.PropertyT("restrictMovement"), out var __jsonRestrictMovement) ? (string)__jsonRestrictMovement : (string)RestrictMovement;} + {_restrictMovement = If( json?.PropertyT("restrictMovement"), out var __jsonRestrictMovement) ? (string)__jsonRestrictMovement : (string)_restrictMovement;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.PowerShell.cs index f7ad39376301..12f43c9391bd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class VirtualMachinesList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IVirtualMachinesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachinesList(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.VMware.Models.Api20211201.IVirtualMachinesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachinesList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirt /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal VirtualMachinesList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).NextLink, 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. @@ -153,11 +153,11 @@ internal VirtualMachinesList(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.TypeConverter.cs index 8506da9fa032..9121cc590bc4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachinesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.cs index 3fc99c238cb5..faeb7f32559a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of Virtual Machines public partial class VirtualMachinesList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class VirtualMachinesList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[] _value; + private System.Collections.Generic.List _value; /// The items to be displayed on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public VirtualMachinesList() @@ -47,6 +47,9 @@ public partial interface IVirtualMachinesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IVirtualMachinesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items to be displayed on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine) })] + System.Collections.Generic.List Value { get; } } /// A list of Virtual Machines @@ -68,7 +74,7 @@ internal partial interface IVirtualMachinesListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items to be displayed on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.json.cs index b4aec45ae87c..71e8f1b81ff5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/VirtualMachinesList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/VirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachinesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachinesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new VirtualMachinesList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal VirtualMachinesList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachine) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachine.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.VMware.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.VMware.Models.IVirtualMachine) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachine.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.PowerShell.cs new file mode 100644 index 000000000000..c1972f5932d2 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.PowerShell.cs @@ -0,0 +1,180 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// Workload Network + [System.ComponentModel.TypeConverter(typeof(WorkloadNetworkTypeConverter))] + public partial class WorkloadNetwork + { + + /// + /// 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.VMware.Models.IWorkloadNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkloadNetwork(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.VMware.Models.IWorkloadNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkloadNetwork(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.VMware.Models.IWorkloadNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 WorkloadNetwork(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, 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 WorkloadNetwork(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Workload Network + [System.ComponentModel.TypeConverter(typeof(WorkloadNetworkTypeConverter))] + public partial interface IWorkloadNetwork + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.TypeConverter.cs new file mode 100644 index 000000000000..7da96ff4913a --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WorkloadNetworkTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WorkloadNetwork.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WorkloadNetwork.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WorkloadNetwork.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.cs new file mode 100644 index 000000000000..f1fe4d0176e9 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.cs @@ -0,0 +1,77 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// Workload Network + public partial class WorkloadNetwork : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); + + /// Resource ID. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } + + /// Resource name. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.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); } + + /// Resource type. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); + } + + /// Creates an new instance. + public WorkloadNetwork() + { + + } + } + /// Workload Network + public partial interface IWorkloadNetwork : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource + { + + } + /// Workload Network + internal partial interface IWorkloadNetworkInternal : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.json.cs new file mode 100644 index 000000000000..1a6f52e78acf --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetwork.json.cs @@ -0,0 +1,108 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// Workload Network + public partial class WorkloadNetwork + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetwork(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __proxyResource?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadNetwork(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.PowerShell.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.PowerShell.cs index af50f03f5786..827289fd4b69 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDhcp partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDhcp DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDhcp(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.VMware.Models.Api20211201.IWorkloadNetworkDhcp DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDhcp(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,45 +128,45 @@ internal WorkloadNetworkDhcp(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntityTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Revision, (__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. @@ -181,39 +181,39 @@ internal WorkloadNetworkDhcp(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntityTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntityTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.TypeConverter.cs index 152cc60fc46b..ac39ed1ca322 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.cs similarity index 56% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.cs index 290064d3b059..7ce305876ace 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.cs @@ -3,66 +3,65 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DHCP public partial class WorkloadNetworkDhcp : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Type of DHCP: SERVER or RELAY. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum? DhcpType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).DhcpType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).DhcpType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum)""); } + public string DhcpType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).DhcpType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).DhcpType = value ?? null; } /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).ProvisioningState = value; } /// Internal Acessors for Segment - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpInternal.Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).Segment; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).Segment = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpInternal.Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).Segment; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).Segment = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity _property; /// DHCP properties. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity()); set => this._property = value; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -70,15 +69,15 @@ public partial class WorkloadNetworkDhcp : /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).Revision = value ?? default(long); } /// NSX Segments consuming DHCP. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)Property).Segment; } + public System.Collections.Generic.List Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)Property).Segment; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -88,8 +87,8 @@ public partial class WorkloadNetworkDhcp : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -101,20 +100,27 @@ public WorkloadNetworkDhcp() /// NSX DHCP public partial interface IWorkloadNetworkDhcp : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Type of DHCP: SERVER or RELAY. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of DHCP: SERVER or RELAY.", SerializedName = @"dhcpType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum? DhcpType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + string DhcpType { get; set; } /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DHCP entity.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -123,14 +129,21 @@ public partial interface IWorkloadNetworkDhcp : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -139,28 +152,33 @@ public partial interface IWorkloadNetworkDhcp : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"NSX Segments consuming DHCP.", SerializedName = @"segments", PossibleTypes = new [] { typeof(string) })] - string[] Segment { get; } + System.Collections.Generic.List Segment { get; } } /// NSX DHCP internal partial interface IWorkloadNetworkDhcpInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Type of DHCP: SERVER or RELAY. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum? DhcpType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + string DhcpType { get; set; } /// Display name of the DHCP entity. string DisplayName { get; set; } /// DHCP properties. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// NSX Segments consuming DHCP. - string[] Segment { get; set; } + System.Collections.Generic.List Segment { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.json.cs index 5c34d6e56275..f9d1091d3096 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcp.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcp.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDhcp partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDhcp(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkDhcp(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.J { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.PowerShell.cs similarity index 68% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.PowerShell.cs index d19334ec6453..26c776afebdb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class WorkloadNetworkDhcpEntity partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDhcpEntity(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.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDhcpEntity(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +130,29 @@ internal WorkloadNetworkDhcpEntity(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__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. @@ -167,23 +167,23 @@ internal WorkloadNetworkDhcpEntity(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.TypeConverter.cs index 9aaf193fefa6..81e4a695006b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.cs index 4285af2e45a2..86a81ccb8071 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201 /// Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from /// public partial class WorkloadNetworkDhcpEntity : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum _dhcpType; + private string _dhcpType; /// Type of DHCP: SERVER or RELAY. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get => this._dhcpType; set => this._dhcpType = value; } + public string DhcpType { get => this._dhcpType; set => this._dhcpType = value; } /// Backing field for property. private string _displayName; @@ -30,17 +30,17 @@ public partial class WorkloadNetworkDhcpEntity : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Segment - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal.Segment { get => this._segment; set { {_segment = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal.Segment { get => this._segment; set { {_segment = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private long? _revision; @@ -50,11 +50,11 @@ public partial class WorkloadNetworkDhcpEntity : public long? Revision { get => this._revision; set => this._revision = value; } /// Backing field for property. - private string[] _segment; + private System.Collections.Generic.List _segment; /// NSX Segments consuming DHCP. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Segment { get => this._segment; } + public System.Collections.Generic.List Segment { get => this._segment; } /// Creates an new instance. public WorkloadNetworkDhcpEntity() @@ -70,14 +70,21 @@ public partial interface IWorkloadNetworkDhcpEntity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Type of DHCP: SERVER or RELAY.", SerializedName = @"dhcpType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + string DhcpType { get; set; } /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DHCP entity.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -86,14 +93,21 @@ public partial interface IWorkloadNetworkDhcpEntity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -102,10 +116,13 @@ public partial interface IWorkloadNetworkDhcpEntity : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"NSX Segments consuming DHCP.", SerializedName = @"segments", PossibleTypes = new [] { typeof(string) })] - string[] Segment { get; } + System.Collections.Generic.List Segment { get; } } /// Base class for WorkloadNetworkDhcpServer and WorkloadNetworkDhcpRelay to inherit from @@ -113,15 +130,17 @@ internal partial interface IWorkloadNetworkDhcpEntityInternal { /// Type of DHCP: SERVER or RELAY. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + string DhcpType { get; set; } /// Display name of the DHCP entity. string DisplayName { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// NSX Segments consuming DHCP. - string[] Segment { get; set; } + System.Collections.Generic.List Segment { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.json.cs similarity index 89% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.json.cs index 9f3973f2aec6..58baf1378ad0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpEntity.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpEntity.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -56,15 +56,15 @@ public partial class WorkloadNetworkDhcpEntity partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity. - /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity interface is polymorphic, - /// and the precise model class that will get deserialized is determined at runtime based on the payload. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity. + /// Note: the Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity interface is polymorphic, and the + /// precise model class that will get deserialized is determined at runtime based on the payload. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { if (!(node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json)) { @@ -107,7 +107,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } AddIf( null != (((object)this._dhcpType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._dhcpType.ToString()) : null, "dhcpType" ,container.Add ); AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._segment) { @@ -119,7 +119,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("segments",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -140,11 +140,11 @@ internal WorkloadNetworkDhcpEntity(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - {_dhcpType = If( json?.PropertyT("dhcpType"), out var __jsonDhcpType) ? (string)__jsonDhcpType : (string)DhcpType;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_segment = If( json?.PropertyT("segments"), out var __jsonSegments) ? If( __jsonSegments as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Segment;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : Revision;} + {_dhcpType = If( json?.PropertyT("dhcpType"), out var __jsonDhcpType) ? (string)__jsonDhcpType : (string)_dhcpType;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_segment = If( json?.PropertyT("segments"), out var __jsonSegments) ? If( __jsonSegments as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _segment;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : _revision;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.PowerShell.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.PowerShell.cs index f3c5c9fb0c65..1835b4a44555 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDhcpList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDhcpList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDhcpList(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.VMware.Models.Api20211201.IWorkloadNetworkDhcpList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDhcpList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal WorkloadNetworkDhcpList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).NextLink, 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. @@ -153,11 +153,11 @@ internal WorkloadNetworkDhcpList(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.TypeConverter.cs index 9ef4ea607634..889f33f6663e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcpList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.cs index 8610c73b6836..cc2adbe5adc5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX dhcp entities public partial class WorkloadNetworkDhcpList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkDhcpList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkDhcpList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkDhcpList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkDhcpList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX dhcp entities @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkDhcpListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.json.cs index 4460a2cddcbf..0f4f9a077a71 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDhcpList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDhcpList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkDhcpList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runti { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp.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.VMware.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.VMware.Models.IWorkloadNetworkDhcp) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.PowerShell.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.PowerShell.cs index 5cbca906559a..cf6a570b2e9c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDhcpRelay partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDhcpRelay(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.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDhcpRelay(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,33 +128,33 @@ internal WorkloadNetworkDhcpRelay(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("ServerAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress = (string[]) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress = (System.Collections.Generic.List) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__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. @@ -169,27 +169,27 @@ internal WorkloadNetworkDhcpRelay(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("ServerAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress = (string[]) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress = (System.Collections.Generic.List) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelayInternal)this).ServerAddress, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.TypeConverter.cs index f1fcc22601fd..763326cdfbb0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.cs similarity index 53% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.cs index 4a94ce963613..7d41308a3ed6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.cs @@ -3,54 +3,55 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DHCP Relay public partial class WorkloadNetworkDhcpRelay : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelayInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelayInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity(); /// Type of DHCP: SERVER or RELAY. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DhcpType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DhcpType = value ; } + public string DhcpType { get => "RELAY"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DhcpType = "RELAY"; } /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName = value ?? null; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState = value; } /// Internal Acessors for Segment - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal.Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal.Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision = value ?? default(long); } /// NSX Segments consuming DHCP. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string[] Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; } + public System.Collections.Generic.List Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; } /// Backing field for property. - private string[] _serverAddress; + private System.Collections.Generic.List _serverAddress; /// DHCP Relay Addresses. Max 3. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] ServerAddress { get => this._serverAddress; set => this._serverAddress = value; } + public System.Collections.Generic.List ServerAddress { get => this._serverAddress; set => this._serverAddress = value; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -67,30 +68,33 @@ public partial class WorkloadNetworkDhcpRelay : /// Creates an new instance. public WorkloadNetworkDhcpRelay() { - + this.__workloadNetworkDhcpEntity.DhcpType = "RELAY"; } } /// NSX DHCP Relay public partial interface IWorkloadNetworkDhcpRelay : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity { /// DHCP Relay Addresses. Max 3. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DHCP Relay Addresses. Max 3.", SerializedName = @"serverAddresses", PossibleTypes = new [] { typeof(string) })] - string[] ServerAddress { get; set; } + System.Collections.Generic.List ServerAddress { get; set; } } /// NSX DHCP Relay internal partial interface IWorkloadNetworkDhcpRelayInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal { /// DHCP Relay Addresses. Max 3. - string[] ServerAddress { get; set; } + System.Collections.Generic.List ServerAddress { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.json.cs index fd8d3d0fd4bb..144fc8771b15 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpRelay.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpRelay.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDhcpRelay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpRelay FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpRelay FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDhcpRelay(json) : null; } @@ -110,8 +110,8 @@ internal WorkloadNetworkDhcpRelay(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runt { return; } - __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity(json); - {_serverAddress = If( json?.PropertyT("serverAddresses"), out var __jsonServerAddresses) ? If( __jsonServerAddresses as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : ServerAddress;} + __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity(json); + {_serverAddress = If( json?.PropertyT("serverAddresses"), out var __jsonServerAddresses) ? If( __jsonServerAddresses as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _serverAddress;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.PowerShell.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.PowerShell.cs index e7572efa7feb..f452ad681aca 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDhcpServer partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDhcpServer(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.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDhcpServer(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,37 +128,37 @@ internal WorkloadNetworkDhcpServer(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("ServerAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).ServerAddress = (string) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).ServerAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).ServerAddress = (string) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).ServerAddress, global::System.Convert.ToString); } if (content.Contains("LeaseTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).LeaseTime = (long?) content.GetValueForProperty("LeaseTime",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).LeaseTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).LeaseTime = (long?) content.GetValueForProperty("LeaseTime",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).LeaseTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__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. @@ -173,31 +173,31 @@ internal WorkloadNetworkDhcpServer(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("ServerAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).ServerAddress = (string) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).ServerAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).ServerAddress = (string) content.GetValueForProperty("ServerAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).ServerAddress, global::System.Convert.ToString); } if (content.Contains("LeaseTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).LeaseTime = (long?) content.GetValueForProperty("LeaseTime",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal)this).LeaseTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).LeaseTime = (long?) content.GetValueForProperty("LeaseTime",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal)this).LeaseTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("DhcpType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType = (string) content.GetValueForProperty("DhcpType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DhcpType, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Segment")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment = (string[]) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment = (System.Collections.Generic.List) content.GetValueForProperty("Segment",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Segment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.TypeConverter.cs index f1d3552011fb..c2c542d8a9db 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.cs index b7ae12e25ce8..013af1a250a2 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.cs @@ -3,29 +3,30 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DHCP Server public partial class WorkloadNetworkDhcpServer : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServerInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServerInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity(); /// Type of DHCP: SERVER or RELAY. + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Constant] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DhcpType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DhcpType = value ; } + public string DhcpType { get => "SERVER"; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DhcpType = "SERVER"; } /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).DisplayName = value ?? null; } /// Backing field for property. private long? _leaseTime; @@ -35,22 +36,22 @@ public partial class WorkloadNetworkDhcpServer : public long? LeaseTime { get => this._leaseTime; set => this._leaseTime = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState = value; } /// Internal Acessors for Segment - string[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal.Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal.Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).ProvisioningState; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Revision = value ?? default(long); } /// NSX Segments consuming DHCP. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string[] Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; } + public System.Collections.Generic.List Segment { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal)__workloadNetworkDhcpEntity).Segment; } /// Backing field for property. private string _serverAddress; @@ -74,18 +75,21 @@ public partial class WorkloadNetworkDhcpServer : /// Creates an new instance. public WorkloadNetworkDhcpServer() { - + this.__workloadNetworkDhcpEntity.DhcpType = "SERVER"; } } /// NSX DHCP Server public partial interface IWorkloadNetworkDhcpServer : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntity + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntity { /// DHCP Server Lease Time. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DHCP Server Lease Time.", SerializedName = @"leaseTime", PossibleTypes = new [] { typeof(long) })] @@ -94,6 +98,9 @@ public partial interface IWorkloadNetworkDhcpServer : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DHCP Server Address.", SerializedName = @"serverAddress", PossibleTypes = new [] { typeof(string) })] @@ -102,7 +109,7 @@ public partial interface IWorkloadNetworkDhcpServer : } /// NSX DHCP Server internal partial interface IWorkloadNetworkDhcpServerInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpEntityInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpEntityInternal { /// DHCP Server Lease Time. long? LeaseTime { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.json.cs index 22c4a219e237..6c7d745f90a0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDhcpServer.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDhcpServer.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDhcpServer partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcpServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpServer FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDhcpServer(json) : null; } @@ -103,9 +103,9 @@ internal WorkloadNetworkDhcpServer(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpEntity(json); - {_serverAddress = If( json?.PropertyT("serverAddress"), out var __jsonServerAddress) ? (string)__jsonServerAddress : (string)ServerAddress;} - {_leaseTime = If( json?.PropertyT("leaseTime"), out var __jsonLeaseTime) ? (long?)__jsonLeaseTime : LeaseTime;} + __workloadNetworkDhcpEntity = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpEntity(json); + {_serverAddress = If( json?.PropertyT("serverAddress"), out var __jsonServerAddress) ? (string)__jsonServerAddress : (string)_serverAddress;} + {_leaseTime = If( json?.PropertyT("leaseTime"), out var __jsonLeaseTime) ? (long?)__jsonLeaseTime : _leaseTime;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.PowerShell.cs similarity index 57% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.PowerShell.cs index a7d8be18a2d3..b816173b2c1c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDnsService partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDnsService DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDnsService(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.VMware.Models.Api20211201.IWorkloadNetworkDnsService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDnsService(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,57 +128,57 @@ internal WorkloadNetworkDnsService(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServicePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServicePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DnsServiceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP, global::System.Convert.ToString); } if (content.Contains("DefaultDnsZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone, global::System.Convert.ToString); } if (content.Contains("FqdnZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).FqdnZone = (string[]) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).FqdnZone = (System.Collections.Generic.List) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("LogLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).LogLevel = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum?) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).LogLevel, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).LogLevel, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Revision, (__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. @@ -193,51 +193,51 @@ internal WorkloadNetworkDnsService(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServicePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServicePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DnsServiceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DnsServiceIP, global::System.Convert.ToString); } if (content.Contains("DefaultDnsZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).DefaultDnsZone, global::System.Convert.ToString); } if (content.Contains("FqdnZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).FqdnZone = (string[]) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).FqdnZone = (System.Collections.Generic.List) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("LogLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).LogLevel = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum?) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).LogLevel, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).LogLevel, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.TypeConverter.cs index c1a561dca7ae..be29d6dff4f3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.cs similarity index 56% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.cs index 9ef514e6d7cd..903433799125 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.cs @@ -3,78 +3,77 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DNS Service public partial class WorkloadNetworkDnsService : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Default DNS zone of the DNS Service. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DefaultDnsZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).DefaultDnsZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).DefaultDnsZone = value ?? null; } + public string DefaultDnsZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).DefaultDnsZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).DefaultDnsZone = value ?? null; } /// Display name of the DNS Service. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).DisplayName = value ?? null; } /// DNS service IP of the DNS Service. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DnsServiceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).DnsServiceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).DnsServiceIP = value ?? null; } + public string DnsServiceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).DnsServiceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).DnsServiceIP = value ?? null; } /// FQDN zones of the DNS Service. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] FqdnZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).FqdnZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).FqdnZone = value ?? null /* arrayOf */; } + public System.Collections.Generic.List FqdnZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).FqdnZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).FqdnZone = value ?? null /* arrayOf */; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// DNS Service log level. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).LogLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum)""); } + public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).LogLevel = value ?? null; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).Status = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties _property; /// DNS Service properties [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceProperties()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -82,15 +81,15 @@ public partial class WorkloadNetworkDnsService : /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).Revision = value ?? default(long); } /// DNS Service status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)Property).Status; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -100,8 +99,8 @@ public partial class WorkloadNetworkDnsService : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -113,12 +112,15 @@ public WorkloadNetworkDnsService() /// NSX DNS Service public partial interface IWorkloadNetworkDnsService : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Default DNS zone of the DNS Service. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default DNS zone of the DNS Service.", SerializedName = @"defaultDnsZone", PossibleTypes = new [] { typeof(string) })] @@ -127,6 +129,9 @@ public partial interface IWorkloadNetworkDnsService : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DNS Service.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -135,6 +140,9 @@ public partial interface IWorkloadNetworkDnsService : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DNS service IP of the DNS Service.", SerializedName = @"dnsServiceIp", PossibleTypes = new [] { typeof(string) })] @@ -143,30 +151,44 @@ public partial interface IWorkloadNetworkDnsService : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"FQDN zones of the DNS Service.", SerializedName = @"fqdnZones", PossibleTypes = new [] { typeof(string) })] - string[] FqdnZone { get; set; } + System.Collections.Generic.List FqdnZone { get; set; } /// DNS Service log level. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DNS Service log level.", SerializedName = @"logLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? LogLevel { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + string LogLevel { get; set; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -175,15 +197,19 @@ public partial interface IWorkloadNetworkDnsService : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DNS Service status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } } /// NSX DNS Service internal partial interface IWorkloadNetworkDnsServiceInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Default DNS zone of the DNS Service. string DefaultDnsZone { get; set; } @@ -192,17 +218,20 @@ internal partial interface IWorkloadNetworkDnsServiceInternal : /// DNS service IP of the DNS Service. string DnsServiceIP { get; set; } /// FQDN zones of the DNS Service. - string[] FqdnZone { get; set; } + System.Collections.Generic.List FqdnZone { get; set; } /// DNS Service log level. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? LogLevel { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + string LogLevel { get; set; } /// DNS Service properties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// DNS Service status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.json.cs index 49ed4588ef21..88b50ed0237b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsService.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsService.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDnsService partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDnsService(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkDnsService(Microsoft.Azure.PowerShell.Cmdlets.VMware.Run { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.PowerShell.cs similarity index 60% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.PowerShell.cs index 6eb49baf849c..25ca7c9ca307 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkDnsServiceProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDnsServiceProperties(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.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDnsServiceProperties(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,41 +130,41 @@ internal WorkloadNetworkDnsServiceProperties(global::System.Collections.IDiction // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DnsServiceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP, global::System.Convert.ToString); } if (content.Contains("DefaultDnsZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone, global::System.Convert.ToString); } if (content.Contains("FqdnZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone = (string[]) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone = (System.Collections.Generic.List) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("LogLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum?) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision, (__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. @@ -181,35 +179,35 @@ internal WorkloadNetworkDnsServiceProperties(global::System.Management.Automatio // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("DnsServiceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DnsServiceIP, global::System.Convert.ToString); } if (content.Contains("DefaultDnsZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone = (string) content.GetValueForProperty("DefaultDnsZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).DefaultDnsZone, global::System.Convert.ToString); } if (content.Contains("FqdnZone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone = (string[]) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone = (System.Collections.Generic.List) content.GetValueForProperty("FqdnZone",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).FqdnZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("LogLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum?) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).LogLevel, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.TypeConverter.cs index d0b7989957bd..5471f634e16e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.cs similarity index 70% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.cs index 575511d523ad..bbc46b3a55a1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DNS Service Properties public partial class WorkloadNetworkDnsServiceProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal { /// Backing field for property. @@ -35,31 +35,31 @@ public partial class WorkloadNetworkDnsServiceProperties : public string DnsServiceIP { get => this._dnsServiceIP; set => this._dnsServiceIP = value; } /// Backing field for property. - private string[] _fqdnZone; + private System.Collections.Generic.List _fqdnZone; /// FQDN zones of the DNS Service. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] FqdnZone { get => this._fqdnZone; set => this._fqdnZone = value; } + public System.Collections.Generic.List FqdnZone { get => this._fqdnZone; set => this._fqdnZone = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? _logLevel; + private string _logLevel; /// DNS Service log level. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? LogLevel { get => this._logLevel; set => this._logLevel = value; } + public string LogLevel { get => this._logLevel; set => this._logLevel = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicePropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicePropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private long? _revision; @@ -69,11 +69,11 @@ public partial class WorkloadNetworkDnsServiceProperties : public long? Revision { get => this._revision; set => this._revision = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? _status; + private string _status; /// DNS Service status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public WorkloadNetworkDnsServiceProperties() @@ -89,6 +89,9 @@ public partial interface IWorkloadNetworkDnsServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default DNS zone of the DNS Service.", SerializedName = @"defaultDnsZone", PossibleTypes = new [] { typeof(string) })] @@ -97,6 +100,9 @@ public partial interface IWorkloadNetworkDnsServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DNS Service.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +111,9 @@ public partial interface IWorkloadNetworkDnsServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DNS service IP of the DNS Service.", SerializedName = @"dnsServiceIp", PossibleTypes = new [] { typeof(string) })] @@ -113,30 +122,44 @@ public partial interface IWorkloadNetworkDnsServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"FQDN zones of the DNS Service.", SerializedName = @"fqdnZones", PossibleTypes = new [] { typeof(string) })] - string[] FqdnZone { get; set; } + System.Collections.Generic.List FqdnZone { get; set; } /// DNS Service log level. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DNS Service log level.", SerializedName = @"logLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? LogLevel { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + string LogLevel { get; set; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -145,10 +168,14 @@ public partial interface IWorkloadNetworkDnsServiceProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"DNS Service status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } } /// NSX DNS Service Properties @@ -162,15 +189,18 @@ internal partial interface IWorkloadNetworkDnsServicePropertiesInternal /// DNS service IP of the DNS Service. string DnsServiceIP { get; set; } /// FQDN zones of the DNS Service. - string[] FqdnZone { get; set; } + System.Collections.Generic.List FqdnZone { get; set; } /// DNS Service log level. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum? LogLevel { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + string LogLevel { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// DNS Service status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.json.cs index 1e9d93c555b0..0364311be13d 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServiceProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServiceProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDnsServiceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDnsServiceProperties(json) : null; } @@ -98,11 +98,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("fqdnZones",__w); } AddIf( null != (((object)this._logLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._logLevel.ToString()) : null, "logLevel" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -123,14 +123,14 @@ internal WorkloadNetworkDnsServiceProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_dnsServiceIP = If( json?.PropertyT("dnsServiceIp"), out var __jsonDnsServiceIP) ? (string)__jsonDnsServiceIP : (string)DnsServiceIP;} - {_defaultDnsZone = If( json?.PropertyT("defaultDnsZone"), out var __jsonDefaultDnsZone) ? (string)__jsonDefaultDnsZone : (string)DefaultDnsZone;} - {_fqdnZone = If( json?.PropertyT("fqdnZones"), out var __jsonFqdnZones) ? If( __jsonFqdnZones as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : FqdnZone;} - {_logLevel = If( json?.PropertyT("logLevel"), out var __jsonLogLevel) ? (string)__jsonLogLevel : (string)LogLevel;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : Revision;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_dnsServiceIP = If( json?.PropertyT("dnsServiceIp"), out var __jsonDnsServiceIP) ? (string)__jsonDnsServiceIP : (string)_dnsServiceIP;} + {_defaultDnsZone = If( json?.PropertyT("defaultDnsZone"), out var __jsonDefaultDnsZone) ? (string)__jsonDefaultDnsZone : (string)_defaultDnsZone;} + {_fqdnZone = If( json?.PropertyT("fqdnZones"), out var __jsonFqdnZones) ? If( __jsonFqdnZones as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _fqdnZone;} + {_logLevel = If( json?.PropertyT("logLevel"), out var __jsonLogLevel) ? (string)__jsonLogLevel : (string)_logLevel;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : _revision;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.PowerShell.cs index 5413be2fd444..6bb3ebe674e5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkDnsServicesList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDnsServicesList(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.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDnsServicesList(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WorkloadNetworkDnsServicesList(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).NextLink, 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. @@ -155,11 +153,11 @@ internal WorkloadNetworkDnsServicesList(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServiceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServiceTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.TypeConverter.cs index bff9ede3a62f..3b83e5ccd99a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.cs index 862acb042455..a0a7fd70773a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX DNS Services public partial class WorkloadNetworkDnsServicesList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkDnsServicesList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkDnsServicesList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkDnsServicesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkDnsServicesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX DNS Services @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkDnsServicesListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.json.cs index 76ec3bd0ea3c..1cc00a69e3cc 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsServicesList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsServicesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDnsServicesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDnsServicesList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkDnsServicesList(Microsoft.Azure.PowerShell.Cmdlets.VMwar { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService.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.VMware.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.VMware.Models.IWorkloadNetworkDnsService) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.PowerShell.cs similarity index 58% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.PowerShell.cs index 29727c7ec88e..c797fcc18baf 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDnsZone partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDnsZone(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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDnsZone(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,53 +128,53 @@ internal WorkloadNetworkDnsZone(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZonePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZonePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Domain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Domain = (string[]) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Domain, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Domain = (System.Collections.Generic.List) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Domain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("DnsServerIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP = (string[]) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP = (System.Collections.Generic.List) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SourceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).SourceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).SourceIP, global::System.Convert.ToString); } if (content.Contains("DnsService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Revision, (__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. @@ -189,47 +189,47 @@ internal WorkloadNetworkDnsZone(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZonePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZonePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Domain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Domain = (string[]) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Domain, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Domain = (System.Collections.Generic.List) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Domain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("DnsServerIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP = (string[]) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP = (System.Collections.Generic.List) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SourceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).SourceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).SourceIP, global::System.Convert.ToString); } if (content.Contains("DnsService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.TypeConverter.cs index 23b8ba133bec..6eb23d09d101 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.cs similarity index 60% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.cs index 53c52f77fe2d..f733f6d0fa1a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.cs @@ -3,71 +3,70 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DNS Zone public partial class WorkloadNetworkDnsZone : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Display name of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).DisplayName = value ?? null; } /// DNS Server IP array of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] DnsServerIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsServerIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsServerIP = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DnsServerIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsServerIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsServerIP = value ?? null /* arrayOf */; } /// Number of DNS Services using the DNS zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? DnsService { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsService; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsService = value ?? default(long); } + public long? DnsService { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsService; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).DnsService = value ?? default(long); } /// Domain names of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Domain { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).Domain; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).Domain = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Domain { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).Domain; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).Domain = value ?? null /* arrayOf */; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).ProvisioningState = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties _property; /// DNS Zone properties [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneProperties()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -75,15 +74,15 @@ public partial class WorkloadNetworkDnsZone : /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).Revision = value ?? default(long); } /// Source IP of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SourceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).SourceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)Property).SourceIP = value ?? null; } + public string SourceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).SourceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)Property).SourceIP = value ?? null; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -93,8 +92,8 @@ public partial class WorkloadNetworkDnsZone : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -106,12 +105,15 @@ public WorkloadNetworkDnsZone() /// NSX DNS Zone public partial interface IWorkloadNetworkDnsZone : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Display name of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DNS Zone.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -120,14 +122,20 @@ public partial interface IWorkloadNetworkDnsZone : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DNS Server IP array of the DNS Zone.", SerializedName = @"dnsServerIps", PossibleTypes = new [] { typeof(string) })] - string[] DnsServerIP { get; set; } + System.Collections.Generic.List DnsServerIP { get; set; } /// Number of DNS Services using the DNS zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Number of DNS Services using the DNS zone.", SerializedName = @"dnsServices", PossibleTypes = new [] { typeof(long) })] @@ -136,22 +144,32 @@ public partial interface IWorkloadNetworkDnsZone : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Domain names of the DNS Zone.", SerializedName = @"domain", PossibleTypes = new [] { typeof(string) })] - string[] Domain { get; set; } + System.Collections.Generic.List Domain { get; set; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -160,6 +178,9 @@ public partial interface IWorkloadNetworkDnsZone : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source IP of the DNS Zone.", SerializedName = @"sourceIp", PossibleTypes = new [] { typeof(string) })] @@ -168,20 +189,21 @@ public partial interface IWorkloadNetworkDnsZone : } /// NSX DNS Zone internal partial interface IWorkloadNetworkDnsZoneInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Display name of the DNS Zone. string DisplayName { get; set; } /// DNS Server IP array of the DNS Zone. - string[] DnsServerIP { get; set; } + System.Collections.Generic.List DnsServerIP { get; set; } /// Number of DNS Services using the DNS zone. long? DnsService { get; set; } /// Domain names of the DNS Zone. - string[] Domain { get; set; } + System.Collections.Generic.List Domain { get; set; } /// DNS Zone properties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// Source IP of the DNS Zone. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.json.cs index 66f5ffd8608b..6ff5e9801781 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZone.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZone.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDnsZone partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDnsZone(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkDnsZone(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.PowerShell.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.PowerShell.cs index 8fc30fe2a319..3ca7c31a6b79 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkDnsZoneProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDnsZoneProperties(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.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDnsZoneProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,37 +128,37 @@ internal WorkloadNetworkDnsZoneProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Domain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain = (string[]) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain = (System.Collections.Generic.List) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("DnsServerIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP = (string[]) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP = (System.Collections.Generic.List) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SourceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP, global::System.Convert.ToString); } if (content.Contains("DnsService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision, (__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. @@ -175,31 +173,31 @@ internal WorkloadNetworkDnsZoneProperties(global::System.Management.Automation.P // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Domain")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain = (string[]) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain = (System.Collections.Generic.List) content.GetValueForProperty("Domain",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Domain, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("DnsServerIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP = (string[]) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP = (System.Collections.Generic.List) content.GetValueForProperty("DnsServerIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsServerIP, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SourceIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP = (string) content.GetValueForProperty("SourceIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).SourceIP, global::System.Convert.ToString); } if (content.Contains("DnsService")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService = (long?) content.GetValueForProperty("DnsService",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).DnsService, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.TypeConverter.cs index 23d3ef526847..d50926e8256b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.cs index 15d243495f9a..dffe82e922c6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX DNS Zone Properties public partial class WorkloadNetworkDnsZoneProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class WorkloadNetworkDnsZoneProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Backing field for property. - private string[] _dnsServerIP; + private System.Collections.Generic.List _dnsServerIP; /// DNS Server IP array of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] DnsServerIP { get => this._dnsServerIP; set => this._dnsServerIP = value; } + public System.Collections.Generic.List DnsServerIP { get => this._dnsServerIP; set => this._dnsServerIP = value; } /// Backing field for property. private long? _dnsService; @@ -35,21 +35,21 @@ public partial class WorkloadNetworkDnsZoneProperties : public long? DnsService { get => this._dnsService; set => this._dnsService = value; } /// Backing field for property. - private string[] _domain; + private System.Collections.Generic.List _domain; /// Domain names of the DNS Zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Domain { get => this._domain; set => this._domain = value; } + public System.Collections.Generic.List Domain { get => this._domain; set => this._domain = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private long? _revision; @@ -79,6 +79,9 @@ public partial interface IWorkloadNetworkDnsZoneProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DNS Zone.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -87,14 +90,20 @@ public partial interface IWorkloadNetworkDnsZoneProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DNS Server IP array of the DNS Zone.", SerializedName = @"dnsServerIps", PossibleTypes = new [] { typeof(string) })] - string[] DnsServerIP { get; set; } + System.Collections.Generic.List DnsServerIP { get; set; } /// Number of DNS Services using the DNS zone. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Number of DNS Services using the DNS zone.", SerializedName = @"dnsServices", PossibleTypes = new [] { typeof(long) })] @@ -103,22 +112,32 @@ public partial interface IWorkloadNetworkDnsZoneProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Domain names of the DNS Zone.", SerializedName = @"domain", PossibleTypes = new [] { typeof(string) })] - string[] Domain { get; set; } + System.Collections.Generic.List Domain { get; set; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -127,6 +146,9 @@ public partial interface IWorkloadNetworkDnsZoneProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source IP of the DNS Zone.", SerializedName = @"sourceIp", PossibleTypes = new [] { typeof(string) })] @@ -140,13 +162,14 @@ internal partial interface IWorkloadNetworkDnsZonePropertiesInternal /// Display name of the DNS Zone. string DisplayName { get; set; } /// DNS Server IP array of the DNS Zone. - string[] DnsServerIP { get; set; } + System.Collections.Generic.List DnsServerIP { get; set; } /// Number of DNS Services using the DNS zone. long? DnsService { get; set; } /// Domain names of the DNS Zone. - string[] Domain { get; set; } + System.Collections.Generic.List Domain { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// Source IP of the DNS Zone. diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.json.cs index 01647c05a468..e4f09004ddce 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZoneProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZoneProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDnsZoneProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZoneProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZoneProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDnsZoneProperties(json) : null; } @@ -105,7 +105,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } AddIf( null != (((object)this._sourceIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._sourceIP.ToString()) : null, "sourceIp" ,container.Add ); AddIf( null != this._dnsService ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNumber((long)this._dnsService) : null, "dnsServices" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -126,13 +126,13 @@ internal WorkloadNetworkDnsZoneProperties(Microsoft.Azure.PowerShell.Cmdlets.VMw { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_domain = If( json?.PropertyT("domain"), out var __jsonDomain) ? If( __jsonDomain as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Domain;} - {_dnsServerIP = If( json?.PropertyT("dnsServerIps"), out var __jsonDnsServerIps) ? If( __jsonDnsServerIps as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : DnsServerIP;} - {_sourceIP = If( json?.PropertyT("sourceIp"), out var __jsonSourceIP) ? (string)__jsonSourceIP : (string)SourceIP;} - {_dnsService = If( json?.PropertyT("dnsServices"), out var __jsonDnsServices) ? (long?)__jsonDnsServices : DnsService;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : Revision;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_domain = If( json?.PropertyT("domain"), out var __jsonDomain) ? If( __jsonDomain as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _domain;} + {_dnsServerIP = If( json?.PropertyT("dnsServerIps"), out var __jsonDnsServerIps) ? If( __jsonDnsServerIps as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _dnsServerIP;} + {_sourceIP = If( json?.PropertyT("sourceIp"), out var __jsonSourceIP) ? (string)__jsonSourceIP : (string)_sourceIP;} + {_dnsService = If( json?.PropertyT("dnsServices"), out var __jsonDnsServices) ? (long?)__jsonDnsServices : _dnsService;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : _revision;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.PowerShell.cs index db9683f9100d..53105d293859 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkDnsZonesList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkDnsZonesList(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.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkDnsZonesList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal WorkloadNetworkDnsZonesList(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).NextLink, 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. @@ -153,11 +153,11 @@ internal WorkloadNetworkDnsZonesList(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZoneTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZoneTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.TypeConverter.cs index 599a75a9408e..f59df4c0546e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.cs index 8a7cc8cf4286..8c29c2f10a5f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX DNS Zones public partial class WorkloadNetworkDnsZonesList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkDnsZonesList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkDnsZonesList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkDnsZonesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkDnsZonesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX DNS Zones @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkDnsZonesListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.json.cs index b63de748498a..8c14ddbe71da 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkDnsZonesList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkDnsZonesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkDnsZonesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkDnsZonesList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkDnsZonesList(Microsoft.Azure.PowerShell.Cmdlets.VMware.R { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone.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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.PowerShell.cs similarity index 69% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.PowerShell.cs index 53d4ee5bdfeb..7edcc43929a9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkGateway partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkGateway DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkGateway(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.VMware.Models.Api20211201.IWorkloadNetworkGateway DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkGateway(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,33 +128,33 @@ internal WorkloadNetworkGateway(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Path")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Path, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Path, 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. @@ -169,27 +169,27 @@ internal WorkloadNetworkGateway(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Path")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal)this).Path, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal)this).Path, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.TypeConverter.cs index 2e1d379d2d44..e068af6b6ff5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkGateway ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.cs index 0aaff30af56d..f14e5bfaad67 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.cs @@ -3,59 +3,58 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Gateway. public partial class WorkloadNetworkGateway : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Path - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal.Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)Property).Path = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal.Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)Property).Path; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)Property).Path = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayProperties()); set { {_property = value;} } } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// NSX Gateway Path. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)Property).Path; } + public string Path { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)Property).Path; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties _property; /// Gateway properties. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -63,7 +62,7 @@ public partial class WorkloadNetworkGateway : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -73,8 +72,8 @@ public partial class WorkloadNetworkGateway : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -86,12 +85,15 @@ public WorkloadNetworkGateway() /// NSX Gateway. public partial interface IWorkloadNetworkGateway : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Display name of the DHCP entity. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DHCP entity.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +102,9 @@ public partial interface IWorkloadNetworkGateway : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"NSX Gateway Path.", SerializedName = @"path", PossibleTypes = new [] { typeof(string) })] @@ -108,14 +113,14 @@ public partial interface IWorkloadNetworkGateway : } /// NSX Gateway. internal partial interface IWorkloadNetworkGatewayInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Display name of the DHCP entity. string DisplayName { get; set; } /// NSX Gateway Path. string Path { get; set; } /// Gateway properties. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties Property { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.json.cs index 91fdaee16e3a..9e9778ecbee4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGateway.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGateway.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkGateway partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkGateway(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkGateway(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.PowerShell.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.PowerShell.cs index ff549ee9b65f..cf8d48434423 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkGatewayList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkGatewayList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkGatewayList(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.VMware.Models.Api20211201.IWorkloadNetworkGatewayList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkGatewayList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal WorkloadNetworkGatewayList(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).NextLink, 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. @@ -153,11 +153,11 @@ internal WorkloadNetworkGatewayList(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.TypeConverter.cs index 56e144b67f04..e0e319fc4dd9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkGatewayList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.cs index 7c890bc86489..f5c48b298fa0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX Gateways public partial class WorkloadNetworkGatewayList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkGatewayList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkGatewayList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkGatewayList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkGatewayList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX Gateways @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkGatewayListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.json.cs index dc1879412606..3b42aef0056b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkGatewayList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkGatewayList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkGatewayList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Ru { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkGateway) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGateway.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.VMware.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.VMware.Models.IWorkloadNetworkGateway) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGateway.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.PowerShell.cs similarity index 79% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.PowerShell.cs index 2e7e873d9cf9..a5665a52a3f5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkGatewayProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkGatewayProperties(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.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkGatewayProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WorkloadNetworkGatewayProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Path")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).Path, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).Path, 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. @@ -155,11 +153,11 @@ internal WorkloadNetworkGatewayProperties(global::System.Management.Automation.P // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Path")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal)this).Path, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).Path = (string) content.GetValueForProperty("Path",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal)this).Path, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.TypeConverter.cs index aa9c5c37cf89..cd7f3d69c5fc 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.cs similarity index 85% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.cs index d61b1fe89b20..c500bae6bab6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Properties of a NSX Gateway. public partial class WorkloadNetworkGatewayProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal { /// Backing field for property. @@ -21,7 +21,7 @@ public partial class WorkloadNetworkGatewayProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for Path - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayPropertiesInternal.Path { get => this._path; set { {_path = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayPropertiesInternal.Path { get => this._path; set { {_path = value;} } } /// Backing field for property. private string _path; @@ -44,6 +44,9 @@ public partial interface IWorkloadNetworkGatewayProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the DHCP entity.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -52,6 +55,9 @@ public partial interface IWorkloadNetworkGatewayProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"NSX Gateway Path.", SerializedName = @"path", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.json.cs index 77314ddd730e..306a320f0abc 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkGatewayProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkGatewayProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkGatewayProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGatewayProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkGatewayProperties(json) : null; } @@ -85,7 +85,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._path)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._path.ToString()) : null, "path" ,container.Add ); } @@ -105,8 +105,8 @@ internal WorkloadNetworkGatewayProperties(Microsoft.Azure.PowerShell.Cmdlets.VMw { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)Path;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_path = If( json?.PropertyT("path"), out var __jsonPath) ? (string)__jsonPath : (string)_path;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.PowerShell.cs new file mode 100644 index 000000000000..dbe247b150b6 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.PowerShell.cs @@ -0,0 +1,172 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// A list of workload networks + [System.ComponentModel.TypeConverter(typeof(WorkloadNetworkListTypeConverter))] + public partial class WorkloadNetworkList + { + + /// + /// 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.VMware.Models.IWorkloadNetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkloadNetworkList(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.VMware.Models.IWorkloadNetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkloadNetworkList(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.VMware.Models.IWorkloadNetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 WorkloadNetworkList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).NextLink, 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 WorkloadNetworkList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// A list of workload networks + [System.ComponentModel.TypeConverter(typeof(WorkloadNetworkListTypeConverter))] + public partial interface IWorkloadNetworkList + + { + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.TypeConverter.cs new file mode 100644 index 000000000000..f9950d07aea8 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.TypeConverter.cs @@ -0,0 +1,147 @@ +// 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.VMware.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class WorkloadNetworkListTypeConverter : 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) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted 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) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkList ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkList).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return WorkloadNetworkList.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return WorkloadNetworkList.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return WorkloadNetworkList.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// 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/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.cs new file mode 100644 index 000000000000..9a3e56110c13 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.cs @@ -0,0 +1,80 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// A list of workload networks + public partial class WorkloadNetworkList : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkListInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next page if any + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The items on the page + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; } + + /// Creates an new instance. + public WorkloadNetworkList() + { + + } + } + /// A list of workload networks + public partial interface IWorkloadNetworkList : + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable + { + /// URL to get the next page if any + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"URL to get the next page if any", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// The items on the page + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The items on the page", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork) })] + System.Collections.Generic.List Value { get; } + + } + /// A list of workload networks + internal partial interface IWorkloadNetworkListInternal + + { + /// URL to get the next page if any + string NextLink { get; set; } + /// The items on the page + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.json.cs new file mode 100644 index 000000000000..30347bd95a24 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkList.json.cs @@ -0,0 +1,124 @@ +// 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.VMware.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + + /// A list of workload networks + public partial class WorkloadNetworkList + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json 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 JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkList. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkList. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkList(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject instance to deserialize from. + internal WorkloadNetworkList(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.IWorkloadNetwork) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetwork.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.PowerShell.cs similarity index 57% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.PowerShell.cs index 386229184f9c..3c4e3f7ea3b8 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkPortMirroring partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkPortMirroring(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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkPortMirroring(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,53 +128,53 @@ internal WorkloadNetworkPortMirroring(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Source, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Source, global::System.Convert.ToString); } if (content.Contains("Destination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Destination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Destination, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Revision, (__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. @@ -191,47 +189,47 @@ internal WorkloadNetworkPortMirroring(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Source, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Source, global::System.Convert.ToString); } if (content.Contains("Destination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Destination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Destination, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.TypeConverter.cs index 7bfe1d2c2d8f..a82bc78ddfc3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.cs similarity index 55% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.cs index 5c16f3fe0d71..c2533d6d7fcf 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.cs @@ -3,70 +3,69 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Port Mirroring public partial class WorkloadNetworkPortMirroring : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Destination VM Group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Destination { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Destination = value ?? null; } + public string Destination { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Destination = value ?? null; } /// Direction of port mirroring profile. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? Direction { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Direction; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Direction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum)""); } + public string Direction { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Direction; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Direction = value ?? null; } /// Display name of the port mirroring profile. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Status = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties _property; /// Port Mirroring Properties. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringProperties()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -74,19 +73,19 @@ public partial class WorkloadNetworkPortMirroring : /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Revision = value ?? default(long); } /// Source VM Group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Source = value ?? null; } + public string Source { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Source = value ?? null; } /// Port Mirroring Status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)Property).Status; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -96,8 +95,8 @@ public partial class WorkloadNetworkPortMirroring : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -109,12 +108,15 @@ public WorkloadNetworkPortMirroring() /// NSX Port Mirroring public partial interface IWorkloadNetworkPortMirroring : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Destination VM Group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Destination VM Group.", SerializedName = @"destination", PossibleTypes = new [] { typeof(string) })] @@ -123,14 +125,21 @@ public partial interface IWorkloadNetworkPortMirroring : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Direction of port mirroring profile.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? Direction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + string Direction { get; set; } /// Display name of the port mirroring profile. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the port mirroring profile.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -139,14 +148,21 @@ public partial interface IWorkloadNetworkPortMirroring : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -155,6 +171,9 @@ public partial interface IWorkloadNetworkPortMirroring : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source VM Group.", SerializedName = @"source", PossibleTypes = new [] { typeof(string) })] @@ -163,32 +182,39 @@ public partial interface IWorkloadNetworkPortMirroring : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Port Mirroring Status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } } /// NSX Port Mirroring internal partial interface IWorkloadNetworkPortMirroringInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Destination VM Group. string Destination { get; set; } /// Direction of port mirroring profile. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? Direction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + string Direction { get; set; } /// Display name of the port mirroring profile. string DisplayName { get; set; } /// Port Mirroring Properties. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// Source VM Group. string Source { get; set; } /// Port Mirroring Status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.json.cs index 23591f459206..d9150fd459c1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroring.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroring.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkPortMirroring partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkPortMirroring(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkPortMirroring(Microsoft.Azure.PowerShell.Cmdlets.VMware. { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.PowerShell.cs index 4880cb16a3d0..888a8ad117d3 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkPortMirroringList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkPortMirroringList(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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkPortMirroringList(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WorkloadNetworkPortMirroringList(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).NextLink, 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. @@ -155,11 +153,11 @@ internal WorkloadNetworkPortMirroringList(global::System.Management.Automation.P // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.TypeConverter.cs index 050edc07dc7e..e75181f7f50f 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.cs index 29103b41b88d..cbe531d35b6c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX Port Mirroring public partial class WorkloadNetworkPortMirroringList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkPortMirroringList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkPortMirroringList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkPortMirroringList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkPortMirroringList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX Port Mirroring @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkPortMirroringListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.json.cs index d93723a6664c..3b81f882fad5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkPortMirroringList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkPortMirroringList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkPortMirroringList(Microsoft.Azure.PowerShell.Cmdlets.VMw { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring.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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.PowerShell.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.PowerShell.cs index 731bd7a16ee1..9b79201506b7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkPortMirroringProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkPortMirroringProperties(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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkPortMirroringProperties(content); } @@ -98,7 +96,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -118,7 +116,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -133,37 +131,37 @@ internal WorkloadNetworkPortMirroringProperties(global::System.Collections.IDict // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source, global::System.Convert.ToString); } if (content.Contains("Destination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision, (__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. @@ -178,31 +176,31 @@ internal WorkloadNetworkPortMirroringProperties(global::System.Management.Automa // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Direction")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum?) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction = (string) content.GetValueForProperty("Direction",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Direction, global::System.Convert.ToString); } if (content.Contains("Source")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source = (string) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Source, global::System.Convert.ToString); } if (content.Contains("Destination")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Destination, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.TypeConverter.cs index 5608c06fd3ad..29be0b11a98c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.cs similarity index 70% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.cs index ad7eb7035948..65ba4bd20eb0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Port Mirroring Properties public partial class WorkloadNetworkPortMirroringProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class WorkloadNetworkPortMirroringProperties : public string Destination { get => this._destination; set => this._destination = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? _direction; + private string _direction; /// Direction of port mirroring profile. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? Direction { get => this._direction; set => this._direction = value; } + public string Direction { get => this._direction; set => this._direction = value; } /// Backing field for property. private string _displayName; @@ -35,17 +35,17 @@ public partial class WorkloadNetworkPortMirroringProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private long? _revision; @@ -62,11 +62,11 @@ public partial class WorkloadNetworkPortMirroringProperties : public string Source { get => this._source; set => this._source = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? _status; + private string _status; /// Port Mirroring Status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public WorkloadNetworkPortMirroringProperties() @@ -82,6 +82,9 @@ public partial interface IWorkloadNetworkPortMirroringProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Destination VM Group.", SerializedName = @"destination", PossibleTypes = new [] { typeof(string) })] @@ -90,14 +93,21 @@ public partial interface IWorkloadNetworkPortMirroringProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Direction of port mirroring profile.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? Direction { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + string Direction { get; set; } /// Display name of the port mirroring profile. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the port mirroring profile.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -106,14 +116,21 @@ public partial interface IWorkloadNetworkPortMirroringProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -122,6 +139,9 @@ public partial interface IWorkloadNetworkPortMirroringProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Source VM Group.", SerializedName = @"source", PossibleTypes = new [] { typeof(string) })] @@ -130,10 +150,14 @@ public partial interface IWorkloadNetworkPortMirroringProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Port Mirroring Status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } } /// NSX Port Mirroring Properties @@ -143,17 +167,20 @@ internal partial interface IWorkloadNetworkPortMirroringPropertiesInternal /// Destination VM Group. string Destination { get; set; } /// Direction of port mirroring profile. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum? Direction { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + string Direction { get; set; } /// Display name of the port mirroring profile. string DisplayName { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// Source VM Group. string Source { get; set; } /// Port Mirroring Status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.json.cs index f8b6d69cbc95..8c00276f35e0 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPortMirroringProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPortMirroringProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkPortMirroringProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkPortMirroringProperties(json) : null; } @@ -89,11 +89,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi AddIf( null != (((object)this._direction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._direction.ToString()) : null, "direction" ,container.Add ); AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); AddIf( null != (((object)this._destination)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._destination.ToString()) : null, "destination" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -114,13 +114,13 @@ internal WorkloadNetworkPortMirroringProperties(Microsoft.Azure.PowerShell.Cmdle { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)Direction;} - {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} - {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? (string)__jsonDestination : (string)Destination;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : Revision;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_direction = If( json?.PropertyT("direction"), out var __jsonDirection) ? (string)__jsonDirection : (string)_direction;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)_source;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? (string)__jsonDestination : (string)_destination;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : _revision;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.PowerShell.cs similarity index 63% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.PowerShell.cs index cae274f2d8c3..7ec5c7dc4ecd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkPublicIP partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkPublicIP(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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkPublicIP(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,41 +128,41 @@ internal WorkloadNetworkPublicIP(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("NumberOfPublicIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("PublicIPBlock")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).ProvisioningState, 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. @@ -177,35 +177,35 @@ internal WorkloadNetworkPublicIP(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("NumberOfPublicIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("PublicIPBlock")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).PublicIPBlock, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal)this).ProvisioningState, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.TypeConverter.cs index 49fa592b14bd..94a66f44c44b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.cs similarity index 59% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.cs index 190ea87cb997..17f4ae9dd5d7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.cs @@ -3,70 +3,69 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Public IP Block public partial class WorkloadNetworkPublicIP : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Display name of the Public IP Block. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for PublicIPBlock - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPInternal.PublicIPBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).PublicIPBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).PublicIPBlock = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPInternal.PublicIPBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).PublicIPBlock; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).PublicIPBlock = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Number of Public IPs requested. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? NumberOfPublicIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).NumberOfPublicIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).NumberOfPublicIP = value ?? default(long); } + public long? NumberOfPublicIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).NumberOfPublicIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).NumberOfPublicIP = value ?? default(long); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties _property; /// Public IP Block properties [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPProperties()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).ProvisioningState; } /// CIDR Block of the Public IP Block. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string PublicIPBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)Property).PublicIPBlock; } + public string PublicIPBlock { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)Property).PublicIPBlock; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -74,7 +73,7 @@ public partial class WorkloadNetworkPublicIP : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -84,8 +83,8 @@ public partial class WorkloadNetworkPublicIP : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -97,12 +96,15 @@ public WorkloadNetworkPublicIP() /// NSX Public IP Block public partial interface IWorkloadNetworkPublicIP : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Display name of the Public IP Block. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the Public IP Block.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +113,9 @@ public partial interface IWorkloadNetworkPublicIP : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Number of Public IPs requested.", SerializedName = @"numberOfPublicIPs", PossibleTypes = new [] { typeof(long) })] @@ -119,14 +124,21 @@ public partial interface IWorkloadNetworkPublicIP : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// CIDR Block of the Public IP Block. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR Block of the Public IP Block.", SerializedName = @"publicIPBlock", PossibleTypes = new [] { typeof(string) })] @@ -135,16 +147,17 @@ public partial interface IWorkloadNetworkPublicIP : } /// NSX Public IP Block internal partial interface IWorkloadNetworkPublicIPInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Display name of the Public IP Block. string DisplayName { get; set; } /// Number of Public IPs requested. long? NumberOfPublicIP { get; set; } /// Public IP Block properties - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// CIDR Block of the Public IP Block. string PublicIPBlock { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.json.cs index fe8e8f23bcd2..5f7648a2da1a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIP.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIP.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkPublicIP partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkPublicIP(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkPublicIP(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runti { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.PowerShell.cs similarity index 70% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.PowerShell.cs index a8eb8393cda0..d9c9c3f95be1 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkPublicIPProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkPublicIPProperties(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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkPublicIPProperties(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,25 +130,25 @@ internal WorkloadNetworkPublicIPProperties(global::System.Collections.IDictionar // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("NumberOfPublicIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("PublicIPBlock")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState, 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. @@ -165,19 +163,19 @@ internal WorkloadNetworkPublicIPProperties(global::System.Management.Automation. // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("NumberOfPublicIP")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP = (long?) content.GetValueForProperty("NumberOfPublicIP",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).NumberOfPublicIP, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("PublicIPBlock")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock = (string) content.GetValueForProperty("PublicIPBlock",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).PublicIPBlock, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.TypeConverter.cs index 8c1111ceaa42..19849b278d63 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.cs similarity index 76% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.cs index 52572f297b18..1aae4f1e28b9 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Public IP Block Properties public partial class WorkloadNetworkPublicIPProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class WorkloadNetworkPublicIPProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for PublicIPBlock - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPPropertiesInternal.PublicIPBlock { get => this._publicIPBlock; set { {_publicIPBlock = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPPropertiesInternal.PublicIPBlock { get => this._publicIPBlock; set { {_publicIPBlock = value;} } } /// Backing field for property. private long? _numberOfPublicIP; @@ -34,11 +34,11 @@ public partial class WorkloadNetworkPublicIPProperties : public long? NumberOfPublicIP { get => this._numberOfPublicIP; set => this._numberOfPublicIP = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private string _publicIPBlock; @@ -61,6 +61,9 @@ public partial interface IWorkloadNetworkPublicIPProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the Public IP Block.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IWorkloadNetworkPublicIPProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Number of Public IPs requested.", SerializedName = @"numberOfPublicIPs", PossibleTypes = new [] { typeof(long) })] @@ -77,14 +83,21 @@ public partial interface IWorkloadNetworkPublicIPProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// CIDR Block of the Public IP Block. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"CIDR Block of the Public IP Block.", SerializedName = @"publicIPBlock", PossibleTypes = new [] { typeof(string) })] @@ -100,7 +113,8 @@ internal partial interface IWorkloadNetworkPublicIPPropertiesInternal /// Number of Public IPs requested. long? NumberOfPublicIP { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// CIDR Block of the Public IP Block. string PublicIPBlock { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.json.cs index 1bb2af2ec3f9..89530ef3e902 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkPublicIPProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkPublicIPProperties(json) : null; } @@ -86,11 +86,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != this._numberOfPublicIP ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNumber((long)this._numberOfPublicIP) : null, "numberOfPublicIPs" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._publicIPBlock)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._publicIPBlock.ToString()) : null, "publicIPBlock" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -110,10 +110,10 @@ internal WorkloadNetworkPublicIPProperties(Microsoft.Azure.PowerShell.Cmdlets.VM { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_numberOfPublicIP = If( json?.PropertyT("numberOfPublicIPs"), out var __jsonNumberOfPublicIPs) ? (long?)__jsonNumberOfPublicIPs : NumberOfPublicIP;} - {_publicIPBlock = If( json?.PropertyT("publicIPBlock"), out var __jsonPublicIPBlock) ? (string)__jsonPublicIPBlock : (string)PublicIPBlock;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_numberOfPublicIP = If( json?.PropertyT("numberOfPublicIPs"), out var __jsonNumberOfPublicIPs) ? (long?)__jsonNumberOfPublicIPs : _numberOfPublicIP;} + {_publicIPBlock = If( json?.PropertyT("publicIPBlock"), out var __jsonPublicIPBlock) ? (string)__jsonPublicIPBlock : (string)_publicIPBlock;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.PowerShell.cs index 67aec70087b8..d96187fc2dbb 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkPublicIPsList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkPublicIPsList(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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkPublicIPsList(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WorkloadNetworkPublicIPsList(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).NextLink, 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. @@ -155,11 +153,11 @@ internal WorkloadNetworkPublicIPsList(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.TypeConverter.cs index 2c570c7bd5fe..1752c9c8e5a6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.cs index debac5acc6ed..ad168cb46039 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX Public IP Blocks public partial class WorkloadNetworkPublicIPsList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkPublicIPsList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkPublicIPsList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkPublicIPsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkPublicIPsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX Public IP Blocks @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkPublicIPsListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.json.cs index ded4bff692f5..a010962c092e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkPublicIPsList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkPublicIPsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkPublicIPsList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkPublicIPsList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkPublicIPsList(Microsoft.Azure.PowerShell.Cmdlets.VMware. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIP.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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.PowerShell.cs similarity index 54% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.PowerShell.cs index d4921f144ff5..e84c92f83cb7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkSegment partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkSegment DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkSegment(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.VMware.Models.Api20211201.IWorkloadNetworkSegment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkSegment(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,61 +128,61 @@ internal WorkloadNetworkSegment(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Subnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ConnectedGateway")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ConnectedGateway, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ConnectedGateway, global::System.Convert.ToString); } if (content.Contains("PortVif")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).PortVif = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[]) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).PortVif, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).PortVif = (System.Collections.Generic.List) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).PortVif, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("SubnetDhcpRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange = (string[]) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange = (System.Collections.Generic.List) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SubnetGatewayAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress, 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. @@ -197,55 +197,55 @@ internal WorkloadNetworkSegment(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Subnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ConnectedGateway")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ConnectedGateway, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ConnectedGateway, global::System.Convert.ToString); } if (content.Contains("PortVif")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).PortVif = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[]) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).PortVif, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).PortVif = (System.Collections.Generic.List) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).PortVif, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("SubnetDhcpRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange = (string[]) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange = (System.Collections.Generic.List) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SubnetGatewayAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal)this).SubnetGatewayAddress, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.TypeConverter.cs index 7d2bc6de91f1..45712e35ad69 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.cs similarity index 54% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.cs index a72888a4bb12..1f696732cadd 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.cs @@ -3,76 +3,75 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Segment public partial class WorkloadNetworkSegment : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Gateway which to connect segment to. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string ConnectedGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).ConnectedGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).ConnectedGateway = value ?? null; } + public string ConnectedGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).ConnectedGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).ConnectedGateway = value ?? null; } /// Display name of the segment. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for PortVif - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal.PortVif { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).PortVif; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).PortVif = value; } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal.PortVif { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).PortVif; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).PortVif = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Status = value; } /// Internal Acessors for Subnet - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentInternal.Subnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Subnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Subnet = value; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentInternal.Subnet { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Subnet; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Subnet = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Port Vif which segment is associated with. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] PortVif { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).PortVif; } + public System.Collections.Generic.List PortVif { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).PortVif; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties _property; /// The properties of a Workload Segment proxy resource. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentProperties()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -80,23 +79,23 @@ public partial class WorkloadNetworkSegment : /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Revision = value ?? default(long); } /// Segment status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).Status; } /// DHCP Range assigned for subnet. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] SubnetDhcpRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetDhcpRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetDhcpRange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SubnetDhcpRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetDhcpRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetDhcpRange = value ?? null /* arrayOf */; } /// Gateway address. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SubnetGatewayAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetGatewayAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetGatewayAddress = value ?? null; } + public string SubnetGatewayAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetGatewayAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)Property).SubnetGatewayAddress = value ?? null; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -106,8 +105,8 @@ public partial class WorkloadNetworkSegment : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -119,12 +118,15 @@ public WorkloadNetworkSegment() /// NSX Segment public partial interface IWorkloadNetworkSegment : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Gateway which to connect segment to. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gateway which to connect segment to.", SerializedName = @"connectedGateway", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +135,9 @@ public partial interface IWorkloadNetworkSegment : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the segment.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -141,22 +146,32 @@ public partial interface IWorkloadNetworkSegment : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Port Vif which segment is associated with.", SerializedName = @"portVif", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] PortVif { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif) })] + System.Collections.Generic.List PortVif { get; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -165,22 +180,32 @@ public partial interface IWorkloadNetworkSegment : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Segment status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } /// DHCP Range assigned for subnet. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DHCP Range assigned for subnet.", SerializedName = @"dhcpRanges", PossibleTypes = new [] { typeof(string) })] - string[] SubnetDhcpRange { get; set; } + System.Collections.Generic.List SubnetDhcpRange { get; set; } /// Gateway address. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gateway address.", SerializedName = @"gatewayAddress", PossibleTypes = new [] { typeof(string) })] @@ -189,26 +214,28 @@ public partial interface IWorkloadNetworkSegment : } /// NSX Segment internal partial interface IWorkloadNetworkSegmentInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Gateway which to connect segment to. string ConnectedGateway { get; set; } /// Display name of the segment. string DisplayName { get; set; } /// Port Vif which segment is associated with. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] PortVif { get; set; } + System.Collections.Generic.List PortVif { get; set; } /// The properties of a Workload Segment proxy resource. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// Segment status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } /// Subnet which to connect segment to. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet Subnet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet Subnet { get; set; } /// DHCP Range assigned for subnet. - string[] SubnetDhcpRange { get; set; } + System.Collections.Generic.List SubnetDhcpRange { get; set; } /// Gateway address. string SubnetGatewayAddress { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.json.cs index c3bda0923b25..f7baaafb849b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegment.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegment.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkSegment partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkSegment(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkSegment(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.PowerShell.cs similarity index 83% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.PowerShell.cs index 43831ae930c3..7c61d5d8e513 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkSegmentPortVif partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkSegmentPortVif(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.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkSegmentPortVif(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,13 +128,13 @@ internal WorkloadNetworkSegmentPortVif(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("PortName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVifInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVifInternal)this).PortName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVifInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVifInternal)this).PortName, 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. @@ -151,7 +149,7 @@ internal WorkloadNetworkSegmentPortVif(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("PortName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVifInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVifInternal)this).PortName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVifInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVifInternal)this).PortName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.TypeConverter.cs index 3065f9cac001..bcc8ee65dd9a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.cs similarity index 86% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.cs index 970f721ea266..19d875ce7625 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Ports and any VIF attached to segment. public partial class WorkloadNetworkSegmentPortVif : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVifInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVifInternal { /// Backing field for property. @@ -34,6 +34,9 @@ public partial interface IWorkloadNetworkSegmentPortVif : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of port or VIF attached to segment.", SerializedName = @"portName", PossibleTypes = new [] { typeof(string) })] diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.json.cs similarity index 94% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.json.cs index b42db2d27c28..e509ed5f5e05 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentPortVif.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentPortVif.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkSegmentPortVif partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkSegmentPortVif(json) : null; } @@ -101,7 +101,7 @@ internal WorkloadNetworkSegmentPortVif(Microsoft.Azure.PowerShell.Cmdlets.VMware { return; } - {_portName = If( json?.PropertyT("portName"), out var __jsonPortName) ? (string)__jsonPortName : (string)PortName;} + {_portName = If( json?.PropertyT("portName"), out var __jsonPortName) ? (string)__jsonPortName : (string)_portName;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.PowerShell.cs similarity index 56% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.PowerShell.cs index a1575e94ab06..8f6967d1d6ff 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkSegmentProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkSegmentProperties(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.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkSegmentProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,45 +128,45 @@ internal WorkloadNetworkSegmentProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Subnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ConnectedGateway")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway, global::System.Convert.ToString); } if (content.Contains("PortVif")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[]) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif = (System.Collections.Generic.List) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("SubnetDhcpRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange = (string[]) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange = (System.Collections.Generic.List) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SubnetGatewayAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress, 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. @@ -183,39 +181,39 @@ internal WorkloadNetworkSegmentProperties(global::System.Management.Automation.P // actually deserialize if (content.Contains("Subnet")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet) content.GetValueForProperty("Subnet",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Subnet, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnetTypeConverter.ConvertFrom); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("ConnectedGateway")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway = (string) content.GetValueForProperty("ConnectedGateway",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ConnectedGateway, global::System.Convert.ToString); } if (content.Contains("PortVif")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[]) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif = (System.Collections.Generic.List) content.GetValueForProperty("PortVif",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).PortVif, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVifTypeConverter.ConvertFrom)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("SubnetDhcpRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange = (string[]) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange = (System.Collections.Generic.List) content.GetValueForProperty("SubnetDhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetDhcpRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("SubnetGatewayAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress = (string) content.GetValueForProperty("SubnetGatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal)this).SubnetGatewayAddress, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.TypeConverter.cs index 90e2359b3a67..5be2ac567f10 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.cs similarity index 62% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.cs index 0536c51cf41f..8d351b4c9cfa 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Segment Properties public partial class WorkloadNetworkSegmentProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal { /// Backing field for property. @@ -28,30 +28,30 @@ public partial class WorkloadNetworkSegmentProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for PortVif - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal.PortVif { get => this._portVif; set { {_portVif = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal.PortVif { get => this._portVif; set { {_portVif = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Internal Acessors for Subnet - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPropertiesInternal.Subnet { get => (this._subnet = this._subnet ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnet()); set { {_subnet = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPropertiesInternal.Subnet { get => (this._subnet = this._subnet ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnet()); set { {_subnet = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] _portVif; + private System.Collections.Generic.List _portVif; /// Port Vif which segment is associated with. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] PortVif { get => this._portVif; } + public System.Collections.Generic.List PortVif { get => this._portVif; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private long? _revision; @@ -61,26 +61,26 @@ public partial class WorkloadNetworkSegmentProperties : public long? Revision { get => this._revision; set => this._revision = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? _status; + private string _status; /// Segment status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet _subnet; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet _subnet; /// Subnet which to connect segment to. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet Subnet { get => (this._subnet = this._subnet ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnet()); set => this._subnet = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet Subnet { get => (this._subnet = this._subnet ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnet()); set => this._subnet = value; } /// DHCP Range assigned for subnet. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] SubnetDhcpRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)Subnet).DhcpRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)Subnet).DhcpRange = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SubnetDhcpRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)Subnet).DhcpRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)Subnet).DhcpRange = value ?? null /* arrayOf */; } /// Gateway address. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string SubnetGatewayAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)Subnet).GatewayAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)Subnet).GatewayAddress = value ?? null; } + public string SubnetGatewayAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)Subnet).GatewayAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)Subnet).GatewayAddress = value ?? null; } /// Creates an new instance. public WorkloadNetworkSegmentProperties() @@ -96,6 +96,9 @@ public partial interface IWorkloadNetworkSegmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gateway which to connect segment to.", SerializedName = @"connectedGateway", PossibleTypes = new [] { typeof(string) })] @@ -104,6 +107,9 @@ public partial interface IWorkloadNetworkSegmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the segment.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -112,22 +118,32 @@ public partial interface IWorkloadNetworkSegmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Port Vif which segment is associated with.", SerializedName = @"portVif", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] PortVif { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentPortVif) })] + System.Collections.Generic.List PortVif { get; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -136,22 +152,32 @@ public partial interface IWorkloadNetworkSegmentProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Segment status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } /// DHCP Range assigned for subnet. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DHCP Range assigned for subnet.", SerializedName = @"dhcpRanges", PossibleTypes = new [] { typeof(string) })] - string[] SubnetDhcpRange { get; set; } + System.Collections.Generic.List SubnetDhcpRange { get; set; } /// Gateway address. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gateway address.", SerializedName = @"gatewayAddress", PossibleTypes = new [] { typeof(string) })] @@ -167,17 +193,19 @@ internal partial interface IWorkloadNetworkSegmentPropertiesInternal /// Display name of the segment. string DisplayName { get; set; } /// Port Vif which segment is associated with. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif[] PortVif { get; set; } + System.Collections.Generic.List PortVif { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// Segment status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } /// Subnet which to connect segment to. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet Subnet { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet Subnet { get; set; } /// DHCP Range assigned for subnet. - string[] SubnetDhcpRange { get; set; } + System.Collections.Generic.List SubnetDhcpRange { get; set; } /// Gateway address. string SubnetGatewayAddress { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.json.cs index 9d19ec423e4b..d448dc968a65 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkSegmentProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkSegmentProperties(json) : null; } @@ -87,7 +87,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi AddIf( null != this._subnet ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._subnet.ToJson(null,serializationMode) : null, "subnet" ,container.Add ); AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); AddIf( null != (((object)this._connectedGateway)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._connectedGateway.ToString()) : null, "connectedGateway" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._portVif) { @@ -99,11 +99,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("portVif",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -124,13 +124,13 @@ internal WorkloadNetworkSegmentProperties(Microsoft.Azure.PowerShell.Cmdlets.VMw { return; } - {_subnet = If( json?.PropertyT("subnet"), out var __jsonSubnet) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentSubnet.FromJson(__jsonSubnet) : Subnet;} - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_connectedGateway = If( json?.PropertyT("connectedGateway"), out var __jsonConnectedGateway) ? (string)__jsonConnectedGateway : (string)ConnectedGateway;} - {_portVif = If( json?.PropertyT("portVif"), out var __jsonPortVif) ? If( __jsonPortVif as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegmentPortVif) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentPortVif.FromJson(__u) )) ))() : null : PortVif;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : Revision;} + {_subnet = If( json?.PropertyT("subnet"), out var __jsonSubnet) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentSubnet.FromJson(__jsonSubnet) : _subnet;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_connectedGateway = If( json?.PropertyT("connectedGateway"), out var __jsonConnectedGateway) ? (string)__jsonConnectedGateway : (string)_connectedGateway;} + {_portVif = If( json?.PropertyT("portVif"), out var __jsonPortVif) ? If( __jsonPortVif as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.IWorkloadNetworkSegmentPortVif) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentPortVif.FromJson(__u) )) ))() : null : _portVif;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : _revision;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.PowerShell.cs similarity index 78% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.PowerShell.cs index 5dd599f005e3..9bcae2bf3d7c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkSegmentSubnet partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkSegmentSubnet(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.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkSegmentSubnet(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,17 +128,17 @@ internal WorkloadNetworkSegmentSubnet(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("DhcpRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange = (string[]) content.GetValueForProperty("DhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange = (System.Collections.Generic.List) content.GetValueForProperty("DhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("GatewayAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress = (string) content.GetValueForProperty("GatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress = (string) content.GetValueForProperty("GatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress, 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. @@ -155,11 +153,11 @@ internal WorkloadNetworkSegmentSubnet(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("DhcpRange")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange = (string[]) content.GetValueForProperty("DhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange = (System.Collections.Generic.List) content.GetValueForProperty("DhcpRange",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).DhcpRange, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("GatewayAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress = (string) content.GetValueForProperty("GatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress = (string) content.GetValueForProperty("GatewayAddress",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal)this).GatewayAddress, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.TypeConverter.cs index 9d1d9ad982e7..6536c3f289ae 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.cs index cae834fff07d..a7f1279bae61 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// Subnet configuration for segment public partial class WorkloadNetworkSegmentSubnet : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnetInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnetInternal { /// Backing field for property. - private string[] _dhcpRange; + private System.Collections.Generic.List _dhcpRange; /// DHCP Range assigned for subnet. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] DhcpRange { get => this._dhcpRange; set => this._dhcpRange = value; } + public System.Collections.Generic.List DhcpRange { get => this._dhcpRange; set => this._dhcpRange = value; } /// Backing field for property. private string _gatewayAddress; @@ -41,14 +41,20 @@ public partial interface IWorkloadNetworkSegmentSubnet : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"DHCP Range assigned for subnet.", SerializedName = @"dhcpRanges", PossibleTypes = new [] { typeof(string) })] - string[] DhcpRange { get; set; } + System.Collections.Generic.List DhcpRange { get; set; } /// Gateway address. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Gateway address.", SerializedName = @"gatewayAddress", PossibleTypes = new [] { typeof(string) })] @@ -60,7 +66,7 @@ internal partial interface IWorkloadNetworkSegmentSubnetInternal { /// DHCP Range assigned for subnet. - string[] DhcpRange { get; set; } + System.Collections.Generic.List DhcpRange { get; set; } /// Gateway address. string GatewayAddress { get; set; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.json.cs index 63f09f0f34eb..3156fd0282ba 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentSubnet.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentSubnet.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkSegmentSubnet partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentSubnet FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentSubnet FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkSegmentSubnet(json) : null; } @@ -110,8 +110,8 @@ internal WorkloadNetworkSegmentSubnet(Microsoft.Azure.PowerShell.Cmdlets.VMware. { return; } - {_dhcpRange = If( json?.PropertyT("dhcpRanges"), out var __jsonDhcpRanges) ? If( __jsonDhcpRanges as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DhcpRange;} - {_gatewayAddress = If( json?.PropertyT("gatewayAddress"), out var __jsonGatewayAddress) ? (string)__jsonGatewayAddress : (string)GatewayAddress;} + {_dhcpRange = If( json?.PropertyT("dhcpRanges"), out var __jsonDhcpRanges) ? If( __jsonDhcpRanges as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _dhcpRange;} + {_gatewayAddress = If( json?.PropertyT("gatewayAddress"), out var __jsonGatewayAddress) ? (string)__jsonGatewayAddress : (string)_gatewayAddress;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.PowerShell.cs index dca806ce0c8e..abbf40b7240c 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkSegmentsList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkSegmentsList(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.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkSegmentsList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal WorkloadNetworkSegmentsList(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).NextLink, 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. @@ -153,11 +153,11 @@ internal WorkloadNetworkSegmentsList(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.TypeConverter.cs index 9d3b0b0f1861..44a92e794ddc 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.cs index 166fdf141f61..8c022ba966d5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX Segments public partial class WorkloadNetworkSegmentsList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkSegmentsList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkSegmentsList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkSegmentsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkSegmentsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX Segments @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkSegmentsListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.json.cs index 02e4aa84fd29..9c2e2da9f4b7 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkSegmentsList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkSegmentsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkSegmentsList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkSegmentsList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkSegmentsList(Microsoft.Azure.PowerShell.Cmdlets.VMware.R { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment.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.VMware.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.VMware.Models.IWorkloadNetworkSegment) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.PowerShell.cs similarity index 61% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.PowerShell.cs index 829282f0f14b..72f5911519d6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkVMGroup partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkVMGroup(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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkVMGroup(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,45 +128,45 @@ internal WorkloadNetworkVMGroup(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Member")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Member = (string[]) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Member, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Member = (System.Collections.Generic.List) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Member, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Revision, (__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. @@ -181,39 +181,39 @@ internal WorkloadNetworkVMGroup(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupPropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupPropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Member")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Member = (string[]) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Member, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Member = (System.Collections.Generic.List) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Member, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.TypeConverter.cs index 04009595cd57..368b9aa0fb43 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.cs similarity index 55% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.cs index f6121c986c86..9a28d984b859 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.cs @@ -3,66 +3,65 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX VM Group public partial class WorkloadNetworkVMGroup : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Display name of the VM group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Virtual machine members of this group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string[] Member { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Member; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Member = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Member { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Member; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Member = value ?? null /* arrayOf */; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupProperties()); set { {_property = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).ProvisioningState = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).ProvisioningState = value; } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Status = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupInternal.Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Status = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties _property; /// VM Group properties. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupProperties()); set => this._property = value; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).ProvisioningState; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).ProvisioningState; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -70,15 +69,15 @@ public partial class WorkloadNetworkVMGroup : /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Revision = value ?? default(long); } + public long? Revision { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Revision; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Revision = value ?? default(long); } /// VM Group status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)Property).Status; } + public string Status { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)Property).Status; } /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -88,8 +87,8 @@ public partial class WorkloadNetworkVMGroup : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -101,12 +100,15 @@ public WorkloadNetworkVMGroup() /// NSX VM Group public partial interface IWorkloadNetworkVMGroup : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Display name of the VM group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the VM group.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -115,22 +117,32 @@ public partial interface IWorkloadNetworkVMGroup : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Virtual machine members of this group.", SerializedName = @"members", PossibleTypes = new [] { typeof(string) })] - string[] Member { get; set; } + System.Collections.Generic.List Member { get; set; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -139,28 +151,34 @@ public partial interface IWorkloadNetworkVMGroup : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"VM Group status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } } /// NSX VM Group internal partial interface IWorkloadNetworkVMGroupInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Display name of the VM group. string DisplayName { get; set; } /// Virtual machine members of this group. - string[] Member { get; set; } + System.Collections.Generic.List Member { get; set; } /// VM Group properties. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties Property { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// VM Group status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.json.cs index 635bb048785b..0497549c8940 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroup.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroup.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkVMGroup partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkVMGroup(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkVMGroup(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtim { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.PowerShell.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.PowerShell.cs index 4be7ddef066f..389a9016852a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkVMGroupProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkVMGroupProperties(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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkVMGroupProperties(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,29 +128,29 @@ internal WorkloadNetworkVMGroupProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Member")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Member = (string[]) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Member, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Member = (System.Collections.Generic.List) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Member, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision, (__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. @@ -167,23 +165,23 @@ internal WorkloadNetworkVMGroupProperties(global::System.Management.Automation.P // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("Member")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Member = (string[]) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Member, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Member = (System.Collections.Generic.List) content.GetValueForProperty("Member",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Member, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("ProvisioningState")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); } if (content.Contains("Revision")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision = (long?) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal)this).Revision, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.TypeConverter.cs index 290e16aac0dc..111698a9ef62 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -107,14 +107,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.cs index ff460a3dabdc..96e6d32f314e 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX VM Group Properties public partial class WorkloadNetworkVMGroupProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal { /// Backing field for property. @@ -21,24 +21,24 @@ public partial class WorkloadNetworkVMGroupProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Backing field for property. - private string[] _member; + private System.Collections.Generic.List _member; /// Virtual machine members of this group. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public string[] Member { get => this._member; set => this._member = value; } + public System.Collections.Generic.List Member { get => this._member; set => this._member = value; } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupPropertiesInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupPropertiesInternal.Status { get => this._status; set { {_status = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private long? _revision; @@ -48,11 +48,11 @@ public partial class WorkloadNetworkVMGroupProperties : public long? Revision { get => this._revision; set => this._revision = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? _status; + private string _status; /// VM Group status. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Status { get => this._status; } + public string Status { get => this._status; } /// Creates an new instance. public WorkloadNetworkVMGroupProperties() @@ -68,6 +68,9 @@ public partial interface IWorkloadNetworkVMGroupProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the VM group.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -76,22 +79,32 @@ public partial interface IWorkloadNetworkVMGroupProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Virtual machine members of this group.", SerializedName = @"members", PossibleTypes = new [] { typeof(string) })] - string[] Member { get; set; } + System.Collections.Generic.List Member { get; set; } /// The provisioning state [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; } /// NSX revision number. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"NSX revision number.", SerializedName = @"revision", PossibleTypes = new [] { typeof(long) })] @@ -100,10 +113,14 @@ public partial interface IWorkloadNetworkVMGroupProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"VM Group status.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; } } /// NSX VM Group Properties @@ -113,13 +130,15 @@ internal partial interface IWorkloadNetworkVMGroupPropertiesInternal /// Display name of the VM group. string DisplayName { get; set; } /// Virtual machine members of this group. - string[] Member { get; set; } + System.Collections.Generic.List Member { get; set; } /// The provisioning state - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Succeeded", "Failed", "Building", "Deleting", "Updating", "Canceled")] + string ProvisioningState { get; set; } /// NSX revision number. long? Revision { get; set; } /// VM Group status. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SUCCESS", "FAILURE")] + string Status { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.json.cs similarity index 90% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.json.cs index d516cec9dfae..f990f04d4794 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkVMGroupProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkVMGroupProperties(json) : null; } @@ -94,11 +94,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi } container.Add("members",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -119,11 +119,11 @@ internal WorkloadNetworkVMGroupProperties(Microsoft.Azure.PowerShell.Cmdlets.VMw { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Member;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : Revision;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_member = If( json?.PropertyT("members"), out var __jsonMembers) ? If( __jsonMembers as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _member;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_revision = If( json?.PropertyT("revision"), out var __jsonRevision) ? (long?)__jsonRevision : _revision;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.PowerShell.cs index 782da10d9afe..14b7c59f0ada 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class WorkloadNetworkVMGroupsList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkVMGroupsList(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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkVMGroupsList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -113,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -128,17 +128,17 @@ internal WorkloadNetworkVMGroupsList(global::System.Collections.IDictionary cont // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).NextLink, 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. @@ -153,11 +153,11 @@ internal WorkloadNetworkVMGroupsList(global::System.Management.Automation.PSObje // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.TypeConverter.cs similarity index 97% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.TypeConverter.cs index efc38c5a621a..685451c0e50a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.cs similarity index 66% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.cs index 9ee4f9f3ee64..d4239fe280c4 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX VM Groups public partial class WorkloadNetworkVMGroupsList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkVMGroupsList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkVMGroupsList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkVMGroupsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkVMGroupsList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX VM Groups @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkVMGroupsListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.json.cs index f073b175c45a..59dda418686a 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVMGroupsList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVMGroupsList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkVMGroupsList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkVMGroupsList(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -96,7 +96,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -116,8 +116,8 @@ internal WorkloadNetworkVMGroupsList(Microsoft.Azure.PowerShell.Cmdlets.VMware.R { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup.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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.PowerShell.cs similarity index 67% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.PowerShell.cs index 51d8d089d2cd..d57449059f1b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkVirtualMachine partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkVirtualMachine(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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkVirtualMachine(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -115,7 +113,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -130,33 +128,33 @@ internal WorkloadNetworkVirtualMachine(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachinePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachinePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("VMType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).VMType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum?) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).VMType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).VMType = (string) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).VMType, 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. @@ -171,27 +169,27 @@ internal WorkloadNetworkVirtualMachine(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Property")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachinePropertiesTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachinePropertiesTypeConverter.ConvertFrom); } if (content.Contains("Id")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Id, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Id, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("VMType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).VMType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum?) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal)this).VMType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).VMType = (string) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal)this).VMType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.TypeConverter.cs index 687feaa5d9e1..a7e764cf2f73 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.cs similarity index 58% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.cs index d8ab388101e5..7da9c7d48c25 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.cs @@ -3,55 +3,54 @@ // 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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Virtual Machine public partial class WorkloadNetworkVirtualMachine : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IValidates { /// - /// Backing field for Inherited model + /// Backing field for Inherited model /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(); /// Display name of the VM. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).DisplayName = value ?? null; } + public string DisplayName { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).DisplayName = value ?? null; } /// Resource ID. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; } + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Id = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Id = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineProperties()); set { {_property = value;} } } /// Internal Acessors for VMType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineInternal.VMType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).VMType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).VMType = value; } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineInternal.VMType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).VMType; set => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).VMType = value; } /// Resource name. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Name; } + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Name; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties _property; /// Virtual machine properties. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineProperties()); set => this._property = value; } /// Gets the resource group name [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] @@ -59,11 +58,11 @@ public partial class WorkloadNetworkVirtualMachine : /// Resource type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal)__resource).Type; } + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceInternal)__proxyResource).Type; } /// Virtual machine type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? VMType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).VMType; } + public string VMType { get => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)Property).VMType; } /// Validates that this object meets the validation criteria. /// an instance that will receive validation @@ -73,8 +72,8 @@ public partial class WorkloadNetworkVirtualMachine : /// public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + await eventListener.AssertNotNull(nameof(__proxyResource), __proxyResource); + await eventListener.AssertObjectIsValid(nameof(__proxyResource), __proxyResource); } /// Creates an new instance. @@ -86,12 +85,15 @@ public WorkloadNetworkVirtualMachine() /// NSX Virtual Machine public partial interface IWorkloadNetworkVirtualMachine : Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResource + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResource { /// Display name of the VM. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the VM.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -100,22 +102,27 @@ public partial interface IWorkloadNetworkVirtualMachine : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Virtual machine type.", SerializedName = @"vmType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? VMType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("REGULAR", "EDGE", "SERVICE")] + string VMType { get; } } /// NSX Virtual Machine internal partial interface IWorkloadNetworkVirtualMachineInternal : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IProxyResourceInternal { /// Display name of the VM. string DisplayName { get; set; } /// Virtual machine properties. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties Property { get; set; } /// Virtual machine type. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? VMType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("REGULAR", "EDGE", "SERVICE")] + string VMType { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.json.cs similarity index 91% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.json.cs index b26d2ad30994..904512f5a265 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachine.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachine.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkVirtualMachine partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkVirtualMachine(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - __resource?.ToJson(container, serializationMode); + __proxyResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AfterToJson(ref container); return container; @@ -102,8 +102,8 @@ internal WorkloadNetworkVirtualMachine(Microsoft.Azure.PowerShell.Cmdlets.VMware { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineProperties.FromJson(__jsonProperties) : Property;} + __proxyResource = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ProxyResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.PowerShell.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.PowerShell.cs index 6aad6e0ba55b..3d930a025456 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkVirtualMachineProperties partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkVirtualMachineProperties(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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkVirtualMachineProperties(content); } @@ -98,7 +96,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -118,7 +116,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -133,17 +131,17 @@ internal WorkloadNetworkVirtualMachineProperties(global::System.Collections.IDic // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("VMType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum?) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType = (string) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType, 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,11 +156,11 @@ internal WorkloadNetworkVirtualMachineProperties(global::System.Management.Autom // actually deserialize if (content.Contains("DisplayName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).DisplayName, global::System.Convert.ToString); } if (content.Contains("VMType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum?) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType = (string) content.GetValueForProperty("VMType",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal)this).VMType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.TypeConverter.cs index 72245257ccc3..6d6807df21b5 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -110,14 +110,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.cs similarity index 71% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.cs index 821956455af2..47b2b26f2a33 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// NSX Virtual Machine Properties public partial class WorkloadNetworkVirtualMachineProperties : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal { /// Backing field for property. @@ -21,14 +21,14 @@ public partial class WorkloadNetworkVirtualMachineProperties : public string DisplayName { get => this._displayName; set => this._displayName = value; } /// Internal Acessors for VMType - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinePropertiesInternal.VMType { get => this._vMType; set { {_vMType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinePropertiesInternal.VMType { get => this._vMType; set { {_vMType = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? _vMType; + private string _vMType; /// Virtual machine type. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? VMType { get => this._vMType; } + public string VMType { get => this._vMType; } /// Creates an new instance. public WorkloadNetworkVirtualMachineProperties() @@ -44,6 +44,9 @@ public partial interface IWorkloadNetworkVirtualMachineProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Display name of the VM.", SerializedName = @"displayName", PossibleTypes = new [] { typeof(string) })] @@ -52,10 +55,14 @@ public partial interface IWorkloadNetworkVirtualMachineProperties : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Virtual machine type.", SerializedName = @"vmType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? VMType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("REGULAR", "EDGE", "SERVICE")] + string VMType { get; } } /// NSX Virtual Machine Properties @@ -65,7 +72,8 @@ internal partial interface IWorkloadNetworkVirtualMachinePropertiesInternal /// Display name of the VM. string DisplayName { get; set; } /// Virtual machine type. - Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum? VMType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("REGULAR", "EDGE", "SERVICE")] + string VMType { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.json.cs similarity index 93% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.json.cs index a7b0399351cd..e09398f04906 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachineProperties.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachineProperties.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkVirtualMachineProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkVirtualMachineProperties(json) : null; } @@ -87,7 +87,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi return container; } AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vMType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._vMType.ToString()) : null, "vmType" ,container.Add ); } @@ -107,8 +107,8 @@ internal WorkloadNetworkVirtualMachineProperties(Microsoft.Azure.PowerShell.Cmdl { return; } - {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} - {_vMType = If( json?.PropertyT("vmType"), out var __jsonVMType) ? (string)__jsonVMType : (string)VMType;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)_displayName;} + {_vMType = If( json?.PropertyT("vmType"), out var __jsonVMType) ? (string)__jsonVMType : (string)_vMType;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.PowerShell.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.PowerShell.cs similarity index 75% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.PowerShell.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.PowerShell.cs index a5d69346770d..5df965d951e6 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.PowerShell.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class WorkloadNetworkVirtualMachinesList partial void OverrideToString(ref string stringResult, ref bool returnNow); /// - /// 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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new WorkloadNetworkVirtualMachinesList(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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new WorkloadNetworkVirtualMachinesList(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWork /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -117,7 +115,7 @@ public override string ToString() } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -132,17 +130,17 @@ internal WorkloadNetworkVirtualMachinesList(global::System.Collections.IDictiona // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink, 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. @@ -157,11 +155,11 @@ internal WorkloadNetworkVirtualMachinesList(global::System.Management.Automation // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachineTypeConverter.ConvertFrom)); } if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal)this).NextLink, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.TypeConverter.cs similarity index 96% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.TypeConverter.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.TypeConverter.cs index a39896826882..abf2390e8a86 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.TypeConverter.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; @@ -108,14 +108,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.cs similarity index 65% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.cs index a8d99aaf2cea..f96be6312b9b 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; /// A list of NSX Virtual Machines public partial class WorkloadNetworkVirtualMachinesList : - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal { /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[] Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesListInternal.Value { get => this._value; set { {_value = value;} } } + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesListInternal.Value { get => this._value; set { {_value = value;} } } /// Backing field for property. private string _nextLink; @@ -27,11 +27,11 @@ public partial class WorkloadNetworkVirtualMachinesList : public string NextLink { get => this._nextLink; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[] _value; + private System.Collections.Generic.List _value; /// The items on the page [Microsoft.Azure.PowerShell.Cmdlets.VMware.Origin(Microsoft.Azure.PowerShell.Cmdlets.VMware.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[] Value { get => this._value; } + public System.Collections.Generic.List Value { get => this._value; } /// Creates an new instance. public WorkloadNetworkVirtualMachinesList() @@ -47,6 +47,9 @@ public partial interface IWorkloadNetworkVirtualMachinesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"URL to get the next page if any", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,13 @@ public partial interface IWorkloadNetworkVirtualMachinesList : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The items on the page", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine) })] - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[] Value { get; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine) })] + System.Collections.Generic.List Value { get; } } /// A list of NSX Virtual Machines @@ -68,7 +74,7 @@ internal partial interface IWorkloadNetworkVirtualMachinesListInternal /// URL to get the next page if any string NextLink { get; set; } /// The items on the page - Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.json.cs b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.json.cs similarity index 88% rename from src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.json.cs rename to src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.json.cs index 2b46701d7f88..120573185796 100644 --- a/src/VMware/VMware.Autorest/generated/api/Models/Api20211201/WorkloadNetworkVirtualMachinesList.json.cs +++ b/src/VMware/VMware.Autorest/generated/api/Models/WorkloadNetworkVirtualMachinesList.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.VMware.Models.Api20211201 +namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Models { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class WorkloadNetworkVirtualMachinesList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json ? new WorkloadNetworkVirtualMachinesList(json) : null; } @@ -85,7 +85,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { if (null != this._value) { @@ -97,7 +97,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode ToJson(Mi container.Add("value",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); } @@ -117,8 +117,8 @@ internal WorkloadNetworkVirtualMachinesList(Microsoft.Azure.PowerShell.Cmdlets.V { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachine.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.VMware.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.VMware.Models.IWorkloadNetworkVirtualMachine) (Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachine.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} AfterFromJson(json); } } diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.Completer.cs deleted file mode 100644 index 7bab9f0bdac9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.Completer.cs +++ /dev/null @@ -1,55 +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.VMware.Support -{ - - /// The state of the addon provisioning - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningStateTypeConverter))] - public partial struct AddonProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.TypeConverter.cs deleted file mode 100644 index 5f81c22ba7ce..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.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.VMware.Support -{ - - /// The state of the addon provisioning - public partial class AddonProvisioningStateTypeConverter : - 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) => AddonProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.cs deleted file mode 100644 index 417454c0ec51..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AddonProvisioningState.cs +++ /dev/null @@ -1,106 +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.VMware.Support -{ - - /// The state of the addon provisioning - public partial struct AddonProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState Updating = @"Updating"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AddonProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AddonProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AddonProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AddonProvisioningState - /// 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.VMware.Support.AddonProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AddonProvisioningState (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 AddonProvisioningState && Equals((AddonProvisioningState)obj); - } - - /// Returns hashCode for enum AddonProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AddonProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AddonProvisioningState - /// the value to convert to an instance of . - - public static implicit operator AddonProvisioningState(string value) - { - return new AddonProvisioningState(value); - } - - /// Implicit operator to convert AddonProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum AddonProvisioningState - /// 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.VMware.Support.AddonProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AddonProvisioningState - /// 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.VMware.Support.AddonProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AddonType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/AddonType.Completer.cs deleted file mode 100644 index 9755f88cb8ea..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AddonType.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.VMware.Support -{ - - /// The type of private cloud addon - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonTypeTypeConverter))] - public partial struct AddonType : - 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) || "SRM".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SRM'", "SRM", global::System.Management.Automation.CompletionResultType.ParameterValue, "SRM"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "VR".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'VR'", "VR", global::System.Management.Automation.CompletionResultType.ParameterValue, "VR"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "HCX".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'HCX'", "HCX", global::System.Management.Automation.CompletionResultType.ParameterValue, "HCX"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AddonType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/AddonType.TypeConverter.cs deleted file mode 100644 index 326b27e73609..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AddonType.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.VMware.Support -{ - - /// The type of private cloud addon - public partial class AddonTypeTypeConverter : - 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) => AddonType.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/src/VMware/VMware.Autorest/generated/api/Support/AddonType.cs b/src/VMware/VMware.Autorest/generated/api/Support/AddonType.cs deleted file mode 100644 index 9b86d036dd84..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AddonType.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.VMware.Support -{ - - /// The type of private cloud addon - public partial struct AddonType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType Hcx = @"HCX"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType Srm = @"SRM"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType Vr = @"VR"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AddonType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AddonType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AddonType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AddonType - /// 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.VMware.Support.AddonType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AddonType (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 AddonType && Equals((AddonType)obj); - } - - /// Returns hashCode for enum AddonType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AddonType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AddonType - /// the value to convert to an instance of . - - public static implicit operator AddonType(string value) - { - return new AddonType(value); - } - - /// Implicit operator to convert AddonType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType e) - { - return e._value; - } - - /// Overriding != operator for enum AddonType - /// 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.VMware.Support.AddonType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AddonType - /// 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.VMware.Support.AddonType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AddonType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.Completer.cs deleted file mode 100644 index 9161f3439181..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.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.VMware.Support -{ - - /// Placement policy affinity type - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityTypeTypeConverter))] - public partial struct AffinityType : - 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) || "Affinity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Affinity'", "Affinity", global::System.Management.Automation.CompletionResultType.ParameterValue, "Affinity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AntiAffinity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AntiAffinity'", "AntiAffinity", global::System.Management.Automation.CompletionResultType.ParameterValue, "AntiAffinity"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.TypeConverter.cs deleted file mode 100644 index a886d87b639d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.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.VMware.Support -{ - - /// Placement policy affinity type - public partial class AffinityTypeTypeConverter : - 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) => AffinityType.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/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.cs b/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.cs deleted file mode 100644 index 3e01316e9de4..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AffinityType.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.VMware.Support -{ - - /// Placement policy affinity type - public partial struct AffinityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType Affinity = @"Affinity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType AntiAffinity = @"AntiAffinity"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AffinityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AffinityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AffinityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AffinityType - /// 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.VMware.Support.AffinityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AffinityType (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 AffinityType && Equals((AffinityType)obj); - } - - /// Returns hashCode for enum AffinityType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AffinityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AffinityType - /// the value to convert to an instance of . - - public static implicit operator AffinityType(string value) - { - return new AffinityType(value); - } - - /// Implicit operator to convert AffinityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType e) - { - return e._value; - } - - /// Overriding != operator for enum AffinityType - /// 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.VMware.Support.AffinityType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AffinityType - /// 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.VMware.Support.AffinityType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.Completer.cs deleted file mode 100644 index d6ac84f593cc..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.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.VMware.Support -{ - - /// The availability strategy for the private cloud - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategyTypeConverter))] - public partial struct AvailabilityStrategy : - 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) || "SingleZone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SingleZone'", "SingleZone", global::System.Management.Automation.CompletionResultType.ParameterValue, "SingleZone"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DualZone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DualZone'", "DualZone", global::System.Management.Automation.CompletionResultType.ParameterValue, "DualZone"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.TypeConverter.cs deleted file mode 100644 index 4c6ca02a938f..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.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.VMware.Support -{ - - /// The availability strategy for the private cloud - public partial class AvailabilityStrategyTypeConverter : - 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) => AvailabilityStrategy.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/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.cs b/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.cs deleted file mode 100644 index 12d4c3c4faab..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/AvailabilityStrategy.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.VMware.Support -{ - - /// The availability strategy for the private cloud - public partial struct AvailabilityStrategy : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy DualZone = @"DualZone"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy SingleZone = @"SingleZone"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private AvailabilityStrategy(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AvailabilityStrategy - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AvailabilityStrategy(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AvailabilityStrategy - /// 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.VMware.Support.AvailabilityStrategy e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AvailabilityStrategy (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 AvailabilityStrategy && Equals((AvailabilityStrategy)obj); - } - - /// Returns hashCode for enum AvailabilityStrategy - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AvailabilityStrategy - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AvailabilityStrategy - /// the value to convert to an instance of . - - public static implicit operator AvailabilityStrategy(string value) - { - return new AvailabilityStrategy(value); - } - - /// Implicit operator to convert AvailabilityStrategy to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy e) - { - return e._value; - } - - /// Overriding != operator for enum AvailabilityStrategy - /// 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.VMware.Support.AvailabilityStrategy e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AvailabilityStrategy - /// 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.VMware.Support.AvailabilityStrategy e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.Completer.cs deleted file mode 100644 index 47bc6412866b..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The state of the cloud link. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatusTypeConverter))] - public partial struct CloudLinkStatus : - 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) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disconnected'", "Disconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disconnected"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.TypeConverter.cs deleted file mode 100644 index c01c5b54276a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.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.VMware.Support -{ - - /// The state of the cloud link. - public partial class CloudLinkStatusTypeConverter : - 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) => CloudLinkStatus.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/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.cs b/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.cs deleted file mode 100644 index 8601ad20c0f9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/CloudLinkStatus.cs +++ /dev/null @@ -1,104 +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.VMware.Support -{ - - /// The state of the cloud link. - public partial struct CloudLinkStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus Disconnected = @"Disconnected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus Failed = @"Failed"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CloudLinkStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CloudLinkStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CloudLinkStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CloudLinkStatus - /// 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.VMware.Support.CloudLinkStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CloudLinkStatus (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 CloudLinkStatus && Equals((CloudLinkStatus)obj); - } - - /// Returns hashCode for enum CloudLinkStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CloudLinkStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CloudLinkStatus - /// the value to convert to an instance of . - - public static implicit operator CloudLinkStatus(string value) - { - return new CloudLinkStatus(value); - } - - /// Implicit operator to convert CloudLinkStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus e) - { - return e._value; - } - - /// Overriding != operator for enum CloudLinkStatus - /// 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.VMware.Support.CloudLinkStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CloudLinkStatus - /// 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.VMware.Support.CloudLinkStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.CloudLinkStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.Completer.cs deleted file mode 100644 index a2bf9a40697e..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The state of the cluster provisioning - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningStateTypeConverter))] - public partial struct ClusterProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.TypeConverter.cs deleted file mode 100644 index 6fd8ada8dbe7..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.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.VMware.Support -{ - - /// The state of the cluster provisioning - public partial class ClusterProvisioningStateTypeConverter : - 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) => ClusterProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.cs deleted file mode 100644 index 068f6fd864d9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ClusterProvisioningState.cs +++ /dev/null @@ -1,104 +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.VMware.Support -{ - - /// The state of the cluster provisioning - public partial struct ClusterProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState Updating = @"Updating"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ClusterProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterProvisioningState - /// 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.VMware.Support.ClusterProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterProvisioningState (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 ClusterProvisioningState && Equals((ClusterProvisioningState)obj); - } - - /// Returns hashCode for enum ClusterProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ClusterProvisioningState(string value) - { - return new ClusterProvisioningState(value); - } - - /// Implicit operator to convert ClusterProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterProvisioningState - /// 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.VMware.Support.ClusterProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterProvisioningState - /// 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.VMware.Support.ClusterProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ClusterProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.Completer.cs deleted file mode 100644 index d1517161af7b..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.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.VMware.Support -{ - - /// The state of the datastore provisioning - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningStateTypeConverter))] - public partial struct DatastoreProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.TypeConverter.cs deleted file mode 100644 index 0013d2b210b5..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.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.VMware.Support -{ - - /// The state of the datastore provisioning - public partial class DatastoreProvisioningStateTypeConverter : - 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) => DatastoreProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.cs deleted file mode 100644 index 8f8afbedec9c..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The state of the datastore provisioning - public partial struct DatastoreProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Creating = @"Creating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to DatastoreProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DatastoreProvisioningState(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DatastoreProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DatastoreProvisioningState - /// 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.VMware.Support.DatastoreProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DatastoreProvisioningState (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 DatastoreProvisioningState && Equals((DatastoreProvisioningState)obj); - } - - /// Returns hashCode for enum DatastoreProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DatastoreProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DatastoreProvisioningState - /// the value to convert to an instance of . - - public static implicit operator DatastoreProvisioningState(string value) - { - return new DatastoreProvisioningState(value); - } - - /// Implicit operator to convert DatastoreProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum DatastoreProvisioningState - /// 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.VMware.Support.DatastoreProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DatastoreProvisioningState - /// 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.VMware.Support.DatastoreProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.Completer.cs deleted file mode 100644 index d49114f9d087..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.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.VMware.Support -{ - - /// The operational status of the datastore - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatusTypeConverter))] - public partial struct DatastoreStatus : - 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) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Accessible".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Accessible'", "Accessible", global::System.Management.Automation.CompletionResultType.ParameterValue, "Accessible"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Inaccessible".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Inaccessible'", "Inaccessible", global::System.Management.Automation.CompletionResultType.ParameterValue, "Inaccessible"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Attached".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Attached'", "Attached", global::System.Management.Automation.CompletionResultType.ParameterValue, "Attached"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Detached".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Detached'", "Detached", global::System.Management.Automation.CompletionResultType.ParameterValue, "Detached"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "LostCommunication".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'LostCommunication'", "LostCommunication", global::System.Management.Automation.CompletionResultType.ParameterValue, "LostCommunication"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DeadOrError".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DeadOrError'", "DeadOrError", global::System.Management.Automation.CompletionResultType.ParameterValue, "DeadOrError"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.TypeConverter.cs deleted file mode 100644 index fa60701b00b5..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.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.VMware.Support -{ - - /// The operational status of the datastore - public partial class DatastoreStatusTypeConverter : - 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) => DatastoreStatus.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/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.cs b/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.cs deleted file mode 100644 index 95e70b3cd507..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DatastoreStatus.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.VMware.Support -{ - - /// The operational status of the datastore - public partial struct DatastoreStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus Accessible = @"Accessible"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus Attached = @"Attached"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus DeadOrError = @"DeadOrError"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus Detached = @"Detached"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus Inaccessible = @"Inaccessible"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus LostCommunication = @"LostCommunication"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus Unknown = @"Unknown"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DatastoreStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DatastoreStatus(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DatastoreStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DatastoreStatus - /// 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.VMware.Support.DatastoreStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DatastoreStatus (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 DatastoreStatus && Equals((DatastoreStatus)obj); - } - - /// Returns hashCode for enum DatastoreStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DatastoreStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DatastoreStatus - /// the value to convert to an instance of . - - public static implicit operator DatastoreStatus(string value) - { - return new DatastoreStatus(value); - } - - /// Implicit operator to convert DatastoreStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus e) - { - return e._value; - } - - /// Overriding != operator for enum DatastoreStatus - /// 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.VMware.Support.DatastoreStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DatastoreStatus - /// 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.VMware.Support.DatastoreStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DatastoreStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.Completer.cs deleted file mode 100644 index 4a25c60d1acd..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.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.VMware.Support -{ - - /// Type of DHCP: SERVER or RELAY. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnumTypeConverter))] - public partial struct DhcpTypeEnum : - 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) || "SERVER".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SERVER'", "SERVER", global::System.Management.Automation.CompletionResultType.ParameterValue, "SERVER"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RELAY".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RELAY'", "RELAY", global::System.Management.Automation.CompletionResultType.ParameterValue, "RELAY"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.TypeConverter.cs deleted file mode 100644 index 0ee532a23fb7..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.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.VMware.Support -{ - - /// Type of DHCP: SERVER or RELAY. - public partial class DhcpTypeEnumTypeConverter : - 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) => DhcpTypeEnum.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/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.cs deleted file mode 100644 index f38a98d965b4..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DhcpTypeEnum.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.VMware.Support -{ - - /// Type of DHCP: SERVER or RELAY. - public partial struct DhcpTypeEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum Relay = @"RELAY"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum Server = @"SERVER"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DhcpTypeEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DhcpTypeEnum(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DhcpTypeEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DhcpTypeEnum - /// 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.VMware.Support.DhcpTypeEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DhcpTypeEnum (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 DhcpTypeEnum && Equals((DhcpTypeEnum)obj); - } - - /// Returns hashCode for enum DhcpTypeEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DhcpTypeEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DhcpTypeEnum - /// the value to convert to an instance of . - - public static implicit operator DhcpTypeEnum(string value) - { - return new DhcpTypeEnum(value); - } - - /// Implicit operator to convert DhcpTypeEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum e) - { - return e._value; - } - - /// Overriding != operator for enum DhcpTypeEnum - /// 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.VMware.Support.DhcpTypeEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DhcpTypeEnum - /// 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.VMware.Support.DhcpTypeEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.Completer.cs deleted file mode 100644 index 38bf903d8cf5..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// DNS Service log level. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnumTypeConverter))] - public partial struct DnsServiceLogLevelEnum : - 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) || "DEBUG".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DEBUG'", "DEBUG", global::System.Management.Automation.CompletionResultType.ParameterValue, "DEBUG"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "INFO".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'INFO'", "INFO", global::System.Management.Automation.CompletionResultType.ParameterValue, "INFO"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "WARNING".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'WARNING'", "WARNING", global::System.Management.Automation.CompletionResultType.ParameterValue, "WARNING"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ERROR".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ERROR'", "ERROR", global::System.Management.Automation.CompletionResultType.ParameterValue, "ERROR"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FATAL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FATAL'", "FATAL", global::System.Management.Automation.CompletionResultType.ParameterValue, "FATAL"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.TypeConverter.cs deleted file mode 100644 index cd82159debcf..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.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.VMware.Support -{ - - /// DNS Service log level. - public partial class DnsServiceLogLevelEnumTypeConverter : - 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) => DnsServiceLogLevelEnum.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/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.cs deleted file mode 100644 index 8333f90b34a1..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceLogLevelEnum.cs +++ /dev/null @@ -1,104 +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.VMware.Support -{ - - /// DNS Service log level. - public partial struct DnsServiceLogLevelEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum Debug = @"DEBUG"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum Error = @"ERROR"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum Fatal = @"FATAL"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum Info = @"INFO"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum Warning = @"WARNING"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DnsServiceLogLevelEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DnsServiceLogLevelEnum(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DnsServiceLogLevelEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DnsServiceLogLevelEnum - /// 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.VMware.Support.DnsServiceLogLevelEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DnsServiceLogLevelEnum (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 DnsServiceLogLevelEnum && Equals((DnsServiceLogLevelEnum)obj); - } - - /// Returns hashCode for enum DnsServiceLogLevelEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DnsServiceLogLevelEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DnsServiceLogLevelEnum - /// the value to convert to an instance of . - - public static implicit operator DnsServiceLogLevelEnum(string value) - { - return new DnsServiceLogLevelEnum(value); - } - - /// Implicit operator to convert DnsServiceLogLevelEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum e) - { - return e._value; - } - - /// Overriding != operator for enum DnsServiceLogLevelEnum - /// 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.VMware.Support.DnsServiceLogLevelEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DnsServiceLogLevelEnum - /// 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.VMware.Support.DnsServiceLogLevelEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.Completer.cs deleted file mode 100644 index a51e34346582..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.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.VMware.Support -{ - - /// DNS Service status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnumTypeConverter))] - public partial struct DnsServiceStatusEnum : - 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) || "SUCCESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SUCCESS'", "SUCCESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "SUCCESS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILURE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FAILURE'", "FAILURE", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILURE"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.TypeConverter.cs deleted file mode 100644 index d83833bcda4f..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.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.VMware.Support -{ - - /// DNS Service status. - public partial class DnsServiceStatusEnumTypeConverter : - 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) => DnsServiceStatusEnum.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/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.cs deleted file mode 100644 index 3da119d255e9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/DnsServiceStatusEnum.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.VMware.Support -{ - - /// DNS Service status. - public partial struct DnsServiceStatusEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum Failure = @"FAILURE"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum Success = @"SUCCESS"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DnsServiceStatusEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DnsServiceStatusEnum(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DnsServiceStatusEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DnsServiceStatusEnum - /// 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.VMware.Support.DnsServiceStatusEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DnsServiceStatusEnum (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 DnsServiceStatusEnum && Equals((DnsServiceStatusEnum)obj); - } - - /// Returns hashCode for enum DnsServiceStatusEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DnsServiceStatusEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DnsServiceStatusEnum - /// the value to convert to an instance of . - - public static implicit operator DnsServiceStatusEnum(string value) - { - return new DnsServiceStatusEnum(value); - } - - /// Implicit operator to convert DnsServiceStatusEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum e) - { - return e._value; - } - - /// Overriding != operator for enum DnsServiceStatusEnum - /// 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.VMware.Support.DnsServiceStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DnsServiceStatusEnum - /// 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.VMware.Support.DnsServiceStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceStatusEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.Completer.cs deleted file mode 100644 index c45c071ee6c9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.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.VMware.Support -{ - - /// The state of key provided - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatusTypeConverter))] - public partial struct EncryptionKeyStatus : - 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) || "Connected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Connected'", "Connected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connected"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AccessDenied".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AccessDenied'", "AccessDenied", global::System.Management.Automation.CompletionResultType.ParameterValue, "AccessDenied"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.TypeConverter.cs deleted file mode 100644 index b19b8ad51341..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.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.VMware.Support -{ - - /// The state of key provided - public partial class EncryptionKeyStatusTypeConverter : - 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) => EncryptionKeyStatus.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/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.cs deleted file mode 100644 index 858dc2b5108e..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionKeyStatus.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.VMware.Support -{ - - /// The state of key provided - public partial struct EncryptionKeyStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus AccessDenied = @"AccessDenied"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus Connected = @"Connected"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to EncryptionKeyStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new EncryptionKeyStatus(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private EncryptionKeyStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type EncryptionKeyStatus - /// 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.VMware.Support.EncryptionKeyStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type EncryptionKeyStatus (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 EncryptionKeyStatus && Equals((EncryptionKeyStatus)obj); - } - - /// Returns hashCode for enum EncryptionKeyStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for EncryptionKeyStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to EncryptionKeyStatus - /// the value to convert to an instance of . - - public static implicit operator EncryptionKeyStatus(string value) - { - return new EncryptionKeyStatus(value); - } - - /// Implicit operator to convert EncryptionKeyStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus e) - { - return e._value; - } - - /// Overriding != operator for enum EncryptionKeyStatus - /// 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.VMware.Support.EncryptionKeyStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum EncryptionKeyStatus - /// 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.VMware.Support.EncryptionKeyStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionKeyStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.Completer.cs deleted file mode 100644 index ed342f060cd3..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.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.VMware.Support -{ - - /// Status of customer managed encryption key - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionStateTypeConverter))] - public partial struct EncryptionState : - 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) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.TypeConverter.cs deleted file mode 100644 index 1f6d26924e6a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.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.VMware.Support -{ - - /// Status of customer managed encryption key - public partial class EncryptionStateTypeConverter : - 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) => EncryptionState.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/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.cs deleted file mode 100644 index 6baae2d16579..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionState.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.VMware.Support -{ - - /// Status of customer managed encryption key - public partial struct EncryptionState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to EncryptionState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new EncryptionState(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private EncryptionState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type EncryptionState - /// 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.VMware.Support.EncryptionState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type EncryptionState (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 EncryptionState && Equals((EncryptionState)obj); - } - - /// Returns hashCode for enum EncryptionState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for EncryptionState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to EncryptionState - /// the value to convert to an instance of . - - public static implicit operator EncryptionState(string value) - { - return new EncryptionState(value); - } - - /// Implicit operator to convert EncryptionState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState e) - { - return e._value; - } - - /// Overriding != operator for enum EncryptionState - /// 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.VMware.Support.EncryptionState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum EncryptionState - /// 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.VMware.Support.EncryptionState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.Completer.cs deleted file mode 100644 index 80a0a15ff889..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.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.VMware.Support -{ - - /// Property of the key if user provided or auto detected - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionTypeTypeConverter))] - public partial struct EncryptionVersionType : - 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) || "Fixed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Fixed'", "Fixed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Fixed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AutoDetected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AutoDetected'", "AutoDetected", global::System.Management.Automation.CompletionResultType.ParameterValue, "AutoDetected"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.TypeConverter.cs deleted file mode 100644 index f7a1b7abab60..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.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.VMware.Support -{ - - /// Property of the key if user provided or auto detected - public partial class EncryptionVersionTypeTypeConverter : - 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) => EncryptionVersionType.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/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.cs b/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.cs deleted file mode 100644 index f599b536bb45..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/EncryptionVersionType.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.VMware.Support -{ - - /// Property of the key if user provided or auto detected - public partial struct EncryptionVersionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType AutoDetected = @"AutoDetected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType Fixed = @"Fixed"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to EncryptionVersionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new EncryptionVersionType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private EncryptionVersionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type EncryptionVersionType - /// 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.VMware.Support.EncryptionVersionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type EncryptionVersionType (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 EncryptionVersionType && Equals((EncryptionVersionType)obj); - } - - /// Returns hashCode for enum EncryptionVersionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for EncryptionVersionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to EncryptionVersionType - /// the value to convert to an instance of . - - public static implicit operator EncryptionVersionType(string value) - { - return new EncryptionVersionType(value); - } - - /// Implicit operator to convert EncryptionVersionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType e) - { - return e._value; - } - - /// Overriding != operator for enum EncryptionVersionType - /// 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.VMware.Support.EncryptionVersionType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum EncryptionVersionType - /// 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.VMware.Support.EncryptionVersionType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionVersionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.Completer.cs deleted file mode 100644 index fd7523610c03..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.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.VMware.Support -{ - - /// The state of the ExpressRoute Circuit Authorization provisioning - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningStateTypeConverter))] - public partial struct ExpressRouteAuthorizationProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.TypeConverter.cs deleted file mode 100644 index f9181f8d60e9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.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.VMware.Support -{ - - /// The state of the ExpressRoute Circuit Authorization provisioning - public partial class ExpressRouteAuthorizationProvisioningStateTypeConverter : - 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) => ExpressRouteAuthorizationProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.cs deleted file mode 100644 index 21543833c7c6..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ExpressRouteAuthorizationProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The state of the ExpressRoute Circuit Authorization provisioning - public partial struct ExpressRouteAuthorizationProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ExpressRouteAuthorizationProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ExpressRouteAuthorizationProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ExpressRouteAuthorizationProvisioningState - /// 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.VMware.Support.ExpressRouteAuthorizationProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ExpressRouteAuthorizationProvisioningState (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 ExpressRouteAuthorizationProvisioningState && Equals((ExpressRouteAuthorizationProvisioningState)obj); - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private ExpressRouteAuthorizationProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum ExpressRouteAuthorizationProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ExpressRouteAuthorizationProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to ExpressRouteAuthorizationProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator ExpressRouteAuthorizationProvisioningState(string value) - { - return new ExpressRouteAuthorizationProvisioningState(value); - } - - /// - /// Implicit operator to convert ExpressRouteAuthorizationProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ExpressRouteAuthorizationProvisioningState - /// 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.VMware.Support.ExpressRouteAuthorizationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ExpressRouteAuthorizationProvisioningState - /// 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.VMware.Support.ExpressRouteAuthorizationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ExpressRouteAuthorizationProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.Completer.cs deleted file mode 100644 index 913be690ded8..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.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.VMware.Support -{ - - /// The state of the ExpressRoute Circuit Authorization provisioning - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningStateTypeConverter))] - public partial struct GlobalReachConnectionProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.TypeConverter.cs deleted file mode 100644 index 91600451eb79..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.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.VMware.Support -{ - - /// The state of the ExpressRoute Circuit Authorization provisioning - public partial class GlobalReachConnectionProvisioningStateTypeConverter : - 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) => GlobalReachConnectionProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.cs deleted file mode 100644 index 1f3340c109ca..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionProvisioningState.cs +++ /dev/null @@ -1,106 +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.VMware.Support -{ - - /// The state of the ExpressRoute Circuit Authorization provisioning - public partial struct GlobalReachConnectionProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to GlobalReachConnectionProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new GlobalReachConnectionProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type GlobalReachConnectionProvisioningState - /// 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.VMware.Support.GlobalReachConnectionProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type GlobalReachConnectionProvisioningState (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 GlobalReachConnectionProvisioningState && Equals((GlobalReachConnectionProvisioningState)obj); - } - - /// Returns hashCode for enum GlobalReachConnectionProvisioningState - /// 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 GlobalReachConnectionProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for GlobalReachConnectionProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to GlobalReachConnectionProvisioningState - /// the value to convert to an instance of . - - public static implicit operator GlobalReachConnectionProvisioningState(string value) - { - return new GlobalReachConnectionProvisioningState(value); - } - - /// Implicit operator to convert GlobalReachConnectionProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum GlobalReachConnectionProvisioningState - /// 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.VMware.Support.GlobalReachConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum GlobalReachConnectionProvisioningState - /// 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.VMware.Support.GlobalReachConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.Completer.cs deleted file mode 100644 index 7d022c3663ac..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.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.VMware.Support -{ - - /// The connection status of the global reach connection - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatusTypeConverter))] - public partial struct GlobalReachConnectionStatus : - 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) || "Connected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Connected'", "Connected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connected"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Connecting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Connecting'", "Connecting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connecting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disconnected'", "Disconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disconnected"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.TypeConverter.cs deleted file mode 100644 index 34d6ff9ad2d1..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.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.VMware.Support -{ - - /// The connection status of the global reach connection - public partial class GlobalReachConnectionStatusTypeConverter : - 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) => GlobalReachConnectionStatus.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/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.cs b/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.cs deleted file mode 100644 index aa5868d7d73f..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/GlobalReachConnectionStatus.cs +++ /dev/null @@ -1,104 +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.VMware.Support -{ - - /// The connection status of the global reach connection - public partial struct GlobalReachConnectionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus Connected = @"Connected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus Connecting = @"Connecting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus Disconnected = @"Disconnected"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to GlobalReachConnectionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new GlobalReachConnectionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type GlobalReachConnectionStatus - /// 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.VMware.Support.GlobalReachConnectionStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type GlobalReachConnectionStatus (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 GlobalReachConnectionStatus && Equals((GlobalReachConnectionStatus)obj); - } - - /// Returns hashCode for enum GlobalReachConnectionStatus - /// 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 GlobalReachConnectionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for GlobalReachConnectionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to GlobalReachConnectionStatus - /// the value to convert to an instance of . - - public static implicit operator GlobalReachConnectionStatus(string value) - { - return new GlobalReachConnectionStatus(value); - } - - /// Implicit operator to convert GlobalReachConnectionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum GlobalReachConnectionStatus - /// 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.VMware.Support.GlobalReachConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum GlobalReachConnectionStatus - /// 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.VMware.Support.GlobalReachConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.GlobalReachConnectionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.Completer.cs deleted file mode 100644 index 285a161d677d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.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.VMware.Support -{ - - /// The status of the HCX Enterprise Site - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatusTypeConverter))] - public partial struct HcxEnterpriseSiteStatus : - 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Consumed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Consumed'", "Consumed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Consumed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deactivated".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deactivated'", "Deactivated", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deactivated"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleted'", "Deleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleted"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.TypeConverter.cs deleted file mode 100644 index 0302c57c438a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.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.VMware.Support -{ - - /// The status of the HCX Enterprise Site - public partial class HcxEnterpriseSiteStatusTypeConverter : - 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) => HcxEnterpriseSiteStatus.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/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.cs b/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.cs deleted file mode 100644 index e1bbb612656e..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/HcxEnterpriseSiteStatus.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.VMware.Support -{ - - /// The status of the HCX Enterprise Site - public partial struct HcxEnterpriseSiteStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus Consumed = @"Consumed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus Deactivated = @"Deactivated"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus Deleted = @"Deleted"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to HcxEnterpriseSiteStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new HcxEnterpriseSiteStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type HcxEnterpriseSiteStatus - /// 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.VMware.Support.HcxEnterpriseSiteStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type HcxEnterpriseSiteStatus (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 HcxEnterpriseSiteStatus && Equals((HcxEnterpriseSiteStatus)obj); - } - - /// Returns hashCode for enum HcxEnterpriseSiteStatus - /// 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 HcxEnterpriseSiteStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for HcxEnterpriseSiteStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to HcxEnterpriseSiteStatus - /// the value to convert to an instance of . - - public static implicit operator HcxEnterpriseSiteStatus(string value) - { - return new HcxEnterpriseSiteStatus(value); - } - - /// Implicit operator to convert HcxEnterpriseSiteStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus e) - { - return e._value; - } - - /// Overriding != operator for enum HcxEnterpriseSiteStatus - /// 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.VMware.Support.HcxEnterpriseSiteStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum HcxEnterpriseSiteStatus - /// 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.VMware.Support.HcxEnterpriseSiteStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.HcxEnterpriseSiteStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.Completer.cs deleted file mode 100644 index 8d8cf797e6e5..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.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.VMware.Support -{ - - /// Connectivity to internet is enabled or disabled - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnumTypeConverter))] - public partial struct InternetEnum : - 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) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.TypeConverter.cs deleted file mode 100644 index ff39126ad4f0..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.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.VMware.Support -{ - - /// Connectivity to internet is enabled or disabled - public partial class InternetEnumTypeConverter : - 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) => InternetEnum.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/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.cs deleted file mode 100644 index de79dfdd615b..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/InternetEnum.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.VMware.Support -{ - - /// Connectivity to internet is enabled or disabled - public partial struct InternetEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to InternetEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new InternetEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type InternetEnum - /// 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.VMware.Support.InternetEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type InternetEnum (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 InternetEnum && Equals((InternetEnum)obj); - } - - /// Returns hashCode for enum InternetEnum - /// 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 InternetEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for InternetEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to InternetEnum - /// the value to convert to an instance of . - - public static implicit operator InternetEnum(string value) - { - return new InternetEnum(value); - } - - /// Implicit operator to convert InternetEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum e) - { - return e._value; - } - - /// Overriding != operator for enum InternetEnum - /// 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.VMware.Support.InternetEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum InternetEnum - /// 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.VMware.Support.InternetEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.Completer.cs deleted file mode 100644 index 5324a1c19b65..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.Completer.cs +++ /dev/null @@ -1,41 +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.VMware.Support -{ - - /// - /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnumTypeConverter))] - public partial struct MountOptionEnum : - 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) || "MOUNT".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MOUNT'", "MOUNT", global::System.Management.Automation.CompletionResultType.ParameterValue, "MOUNT"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ATTACH".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ATTACH'", "ATTACH", global::System.Management.Automation.CompletionResultType.ParameterValue, "ATTACH"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.TypeConverter.cs deleted file mode 100644 index 5d60a30ae70d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.TypeConverter.cs +++ /dev/null @@ -1,61 +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.VMware.Support -{ - - /// - /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN - /// - public partial class MountOptionEnumTypeConverter : - 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) => MountOptionEnum.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/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.cs deleted file mode 100644 index 0bff478ef063..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/MountOptionEnum.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.VMware.Support -{ - - /// - /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN - /// - public partial struct MountOptionEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum Attach = @"ATTACH"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum Mount = @"MOUNT"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to MountOptionEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MountOptionEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MountOptionEnum - /// 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.VMware.Support.MountOptionEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MountOptionEnum (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 MountOptionEnum && Equals((MountOptionEnum)obj); - } - - /// Returns hashCode for enum MountOptionEnum - /// 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 MountOptionEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MountOptionEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MountOptionEnum - /// the value to convert to an instance of . - - public static implicit operator MountOptionEnum(string value) - { - return new MountOptionEnum(value); - } - - /// Implicit operator to convert MountOptionEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum e) - { - return e._value; - } - - /// Overriding != operator for enum MountOptionEnum - /// 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.VMware.Support.MountOptionEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MountOptionEnum - /// 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.VMware.Support.MountOptionEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.Completer.cs deleted file mode 100644 index 1f91aadcb616..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.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.VMware.Support -{ - - /// Is this parameter required or optional - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnumTypeConverter))] - public partial struct OptionalParamEnum : - 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) || "Optional".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Optional'", "Optional", global::System.Management.Automation.CompletionResultType.ParameterValue, "Optional"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Required".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Required'", "Required", global::System.Management.Automation.CompletionResultType.ParameterValue, "Required"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.TypeConverter.cs deleted file mode 100644 index d70e85fe5b16..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.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.VMware.Support -{ - - /// Is this parameter required or optional - public partial class OptionalParamEnumTypeConverter : - 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) => OptionalParamEnum.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/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.cs deleted file mode 100644 index 7d4e56bb1c20..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/OptionalParamEnum.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.VMware.Support -{ - - /// Is this parameter required or optional - public partial struct OptionalParamEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum Optional = @"Optional"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum Required = @"Required"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OptionalParamEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OptionalParamEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OptionalParamEnum - /// 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.VMware.Support.OptionalParamEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OptionalParamEnum (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 OptionalParamEnum && Equals((OptionalParamEnum)obj); - } - - /// Returns hashCode for enum OptionalParamEnum - /// 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 OptionalParamEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OptionalParamEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OptionalParamEnum - /// the value to convert to an instance of . - - public static implicit operator OptionalParamEnum(string value) - { - return new OptionalParamEnum(value); - } - - /// Implicit operator to convert OptionalParamEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum e) - { - return e._value; - } - - /// Overriding != operator for enum OptionalParamEnum - /// 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.VMware.Support.OptionalParamEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OptionalParamEnum - /// 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.VMware.Support.OptionalParamEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.OptionalParamEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.Completer.cs deleted file mode 100644 index 57e99bf3d4c7..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningStateTypeConverter))] - public partial struct PlacementPolicyProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.TypeConverter.cs deleted file mode 100644 index 108a316788b7..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class PlacementPolicyProvisioningStateTypeConverter : - 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) => PlacementPolicyProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.cs deleted file mode 100644 index b3f8417489f2..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The provisioning state - public partial struct PlacementPolicyProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PlacementPolicyProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PlacementPolicyProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PlacementPolicyProvisioningState - /// 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.VMware.Support.PlacementPolicyProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PlacementPolicyProvisioningState (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 PlacementPolicyProvisioningState && Equals((PlacementPolicyProvisioningState)obj); - } - - /// Returns hashCode for enum PlacementPolicyProvisioningState - /// 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 PlacementPolicyProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PlacementPolicyProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PlacementPolicyProvisioningState - /// the value to convert to an instance of . - - public static implicit operator PlacementPolicyProvisioningState(string value) - { - return new PlacementPolicyProvisioningState(value); - } - - /// Implicit operator to convert PlacementPolicyProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum PlacementPolicyProvisioningState - /// 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.VMware.Support.PlacementPolicyProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PlacementPolicyProvisioningState - /// 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.VMware.Support.PlacementPolicyProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.Completer.cs deleted file mode 100644 index cd4ad7640a26..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.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.VMware.Support -{ - - /// Whether the placement policy is enabled or disabled - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyStateTypeConverter))] - public partial struct PlacementPolicyState : - 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) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.TypeConverter.cs deleted file mode 100644 index 5ad089ae769a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.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.VMware.Support -{ - - /// Whether the placement policy is enabled or disabled - public partial class PlacementPolicyStateTypeConverter : - 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) => PlacementPolicyState.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/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.cs deleted file mode 100644 index 0a738f57d412..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyState.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.VMware.Support -{ - - /// Whether the placement policy is enabled or disabled - public partial struct PlacementPolicyState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PlacementPolicyState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PlacementPolicyState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PlacementPolicyState - /// 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.VMware.Support.PlacementPolicyState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PlacementPolicyState (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 PlacementPolicyState && Equals((PlacementPolicyState)obj); - } - - /// Returns hashCode for enum PlacementPolicyState - /// 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 PlacementPolicyState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PlacementPolicyState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PlacementPolicyState - /// the value to convert to an instance of . - - public static implicit operator PlacementPolicyState(string value) - { - return new PlacementPolicyState(value); - } - - /// Implicit operator to convert PlacementPolicyState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState e) - { - return e._value; - } - - /// Overriding != operator for enum PlacementPolicyState - /// 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.VMware.Support.PlacementPolicyState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PlacementPolicyState - /// 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.VMware.Support.PlacementPolicyState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.Completer.cs deleted file mode 100644 index 8329daf36336..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.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.VMware.Support -{ - - /// placement policy type - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyTypeTypeConverter))] - public partial struct PlacementPolicyType : - 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) || "VmVm".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'VmVm'", "VmVm", global::System.Management.Automation.CompletionResultType.ParameterValue, "VmVm"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "VmHost".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'VmHost'", "VmHost", global::System.Management.Automation.CompletionResultType.ParameterValue, "VmHost"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.TypeConverter.cs deleted file mode 100644 index ef355a812ebd..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.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.VMware.Support -{ - - /// placement policy type - public partial class PlacementPolicyTypeTypeConverter : - 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) => PlacementPolicyType.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/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.cs b/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.cs deleted file mode 100644 index c4fc6c1f94fb..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PlacementPolicyType.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.VMware.Support -{ - - /// placement policy type - public partial struct PlacementPolicyType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType VM = @"VmVm"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType VMHost = @"VmHost"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PlacementPolicyType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PlacementPolicyType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PlacementPolicyType - /// 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.VMware.Support.PlacementPolicyType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PlacementPolicyType (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 PlacementPolicyType && Equals((PlacementPolicyType)obj); - } - - /// Returns hashCode for enum PlacementPolicyType - /// 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 PlacementPolicyType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PlacementPolicyType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PlacementPolicyType - /// the value to convert to an instance of . - - public static implicit operator PlacementPolicyType(string value) - { - return new PlacementPolicyType(value); - } - - /// Implicit operator to convert PlacementPolicyType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType e) - { - return e._value; - } - - /// Overriding != operator for enum PlacementPolicyType - /// 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.VMware.Support.PlacementPolicyType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PlacementPolicyType - /// 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.VMware.Support.PlacementPolicyType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.Completer.cs deleted file mode 100644 index 9470d9084d88..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.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.VMware.Support -{ - - /// Direction of port mirroring profile. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnumTypeConverter))] - public partial struct PortMirroringDirectionEnum : - 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) || "INGRESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'INGRESS'", "INGRESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "INGRESS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "EGRESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'EGRESS'", "EGRESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "EGRESS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BIDIRECTIONAL".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BIDIRECTIONAL'", "BIDIRECTIONAL", global::System.Management.Automation.CompletionResultType.ParameterValue, "BIDIRECTIONAL"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.TypeConverter.cs deleted file mode 100644 index 3a142455b3b6..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.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.VMware.Support -{ - - /// Direction of port mirroring profile. - public partial class PortMirroringDirectionEnumTypeConverter : - 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) => PortMirroringDirectionEnum.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/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.cs deleted file mode 100644 index 3e8e741df375..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringDirectionEnum.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.VMware.Support -{ - - /// Direction of port mirroring profile. - public partial struct PortMirroringDirectionEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum Bidirectional = @"BIDIRECTIONAL"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum Egress = @"EGRESS"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum Ingress = @"INGRESS"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PortMirroringDirectionEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PortMirroringDirectionEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PortMirroringDirectionEnum - /// 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.VMware.Support.PortMirroringDirectionEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PortMirroringDirectionEnum (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 PortMirroringDirectionEnum && Equals((PortMirroringDirectionEnum)obj); - } - - /// Returns hashCode for enum PortMirroringDirectionEnum - /// 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 PortMirroringDirectionEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PortMirroringDirectionEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PortMirroringDirectionEnum - /// the value to convert to an instance of . - - public static implicit operator PortMirroringDirectionEnum(string value) - { - return new PortMirroringDirectionEnum(value); - } - - /// Implicit operator to convert PortMirroringDirectionEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum e) - { - return e._value; - } - - /// Overriding != operator for enum PortMirroringDirectionEnum - /// 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.VMware.Support.PortMirroringDirectionEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PortMirroringDirectionEnum - /// 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.VMware.Support.PortMirroringDirectionEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.Completer.cs deleted file mode 100644 index 6f8b4b7fedce..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.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.VMware.Support -{ - - /// Port Mirroring Status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnumTypeConverter))] - public partial struct PortMirroringStatusEnum : - 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) || "SUCCESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SUCCESS'", "SUCCESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "SUCCESS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILURE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FAILURE'", "FAILURE", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILURE"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.TypeConverter.cs deleted file mode 100644 index 98f9257b2e31..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.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.VMware.Support -{ - - /// Port Mirroring Status. - public partial class PortMirroringStatusEnumTypeConverter : - 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) => PortMirroringStatusEnum.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/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.cs deleted file mode 100644 index da653d04a85a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PortMirroringStatusEnum.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.VMware.Support -{ - - /// Port Mirroring Status. - public partial struct PortMirroringStatusEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum Failure = @"FAILURE"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum Success = @"SUCCESS"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to PortMirroringStatusEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PortMirroringStatusEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PortMirroringStatusEnum - /// 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.VMware.Support.PortMirroringStatusEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type PortMirroringStatusEnum (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 PortMirroringStatusEnum && Equals((PortMirroringStatusEnum)obj); - } - - /// Returns hashCode for enum PortMirroringStatusEnum - /// 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 PortMirroringStatusEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PortMirroringStatusEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PortMirroringStatusEnum - /// the value to convert to an instance of . - - public static implicit operator PortMirroringStatusEnum(string value) - { - return new PortMirroringStatusEnum(value); - } - - /// Implicit operator to convert PortMirroringStatusEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum e) - { - return e._value; - } - - /// Overriding != operator for enum PortMirroringStatusEnum - /// 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.VMware.Support.PortMirroringStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PortMirroringStatusEnum - /// 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.VMware.Support.PortMirroringStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringStatusEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.Completer.cs deleted file mode 100644 index 05c1e0cf9f51..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningStateTypeConverter))] - public partial struct PrivateCloudProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.TypeConverter.cs deleted file mode 100644 index 87a1a0e04fb6..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class PrivateCloudProvisioningStateTypeConverter : - 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) => PrivateCloudProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.cs deleted file mode 100644 index 22ce53d51bed..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/PrivateCloudProvisioningState.cs +++ /dev/null @@ -1,114 +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.VMware.Support -{ - - /// The provisioning state - public partial struct PrivateCloudProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to PrivateCloudProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new PrivateCloudProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type PrivateCloudProvisioningState - /// 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.VMware.Support.PrivateCloudProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type PrivateCloudProvisioningState (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 PrivateCloudProvisioningState && Equals((PrivateCloudProvisioningState)obj); - } - - /// Returns hashCode for enum PrivateCloudProvisioningState - /// 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 PrivateCloudProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for PrivateCloudProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to PrivateCloudProvisioningState - /// the value to convert to an instance of . - - public static implicit operator PrivateCloudProvisioningState(string value) - { - return new PrivateCloudProvisioningState(value); - } - - /// Implicit operator to convert PrivateCloudProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum PrivateCloudProvisioningState - /// 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.VMware.Support.PrivateCloudProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum PrivateCloudProvisioningState - /// 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.VMware.Support.PrivateCloudProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PrivateCloudProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.Completer.cs deleted file mode 100644 index 56dd58581bf9..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.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.VMware.Support -{ - - /// Host quota is active for current subscription - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabledTypeConverter))] - public partial struct QuotaEnabled : - 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) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.TypeConverter.cs deleted file mode 100644 index f763f0300f8c..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.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.VMware.Support -{ - - /// Host quota is active for current subscription - public partial class QuotaEnabledTypeConverter : - 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) => QuotaEnabled.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/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.cs b/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.cs deleted file mode 100644 index e0db525e944a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/QuotaEnabled.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.VMware.Support -{ - - /// Host quota is active for current subscription - public partial struct QuotaEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to QuotaEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new QuotaEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type QuotaEnabled - /// 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.VMware.Support.QuotaEnabled e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type QuotaEnabled (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 QuotaEnabled && Equals((QuotaEnabled)obj); - } - - /// Returns hashCode for enum QuotaEnabled - /// 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 QuotaEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for QuotaEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to QuotaEnabled - /// the value to convert to an instance of . - - public static implicit operator QuotaEnabled(string value) - { - return new QuotaEnabled(value); - } - - /// Implicit operator to convert QuotaEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum QuotaEnabled - /// 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.VMware.Support.QuotaEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum QuotaEnabled - /// 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.VMware.Support.QuotaEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.QuotaEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.Completer.cs deleted file mode 100644 index 481ae247fabc..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.Completer.cs +++ /dev/null @@ -1,42 +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.VMware.Support -{ - - /// - /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityTypeTypeConverter))] - public partial struct ResourceIdentityType : - 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) || "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) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.TypeConverter.cs deleted file mode 100644 index f0656a9f6461..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.TypeConverter.cs +++ /dev/null @@ -1,62 +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.VMware.Support -{ - - /// - /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// - public partial class ResourceIdentityTypeTypeConverter : - 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) => ResourceIdentityType.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/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.cs b/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.cs deleted file mode 100644 index 35d2d3c1e0fb..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ResourceIdentityType.cs +++ /dev/null @@ -1,101 +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.VMware.Support -{ - - /// - /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The - /// type 'None' will remove any identities from the Private Cloud. - /// - public partial struct ResourceIdentityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType SystemAssigned = @"SystemAssigned"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ResourceIdentityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ResourceIdentityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ResourceIdentityType - /// 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.VMware.Support.ResourceIdentityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ResourceIdentityType (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 ResourceIdentityType && Equals((ResourceIdentityType)obj); - } - - /// Returns hashCode for enum ResourceIdentityType - /// 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 ResourceIdentityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ResourceIdentityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ResourceIdentityType - /// the value to convert to an instance of . - - public static implicit operator ResourceIdentityType(string value) - { - return new ResourceIdentityType(value); - } - - /// Implicit operator to convert ResourceIdentityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType e) - { - return e._value; - } - - /// Overriding != operator for enum ResourceIdentityType - /// 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.VMware.Support.ResourceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ResourceIdentityType - /// 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.VMware.Support.ResourceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.Completer.cs deleted file mode 100644 index edd3518f3f25..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.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.VMware.Support -{ - - /// The type of execution parameter - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterTypeTypeConverter))] - public partial struct ScriptExecutionParameterType : - 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) || "Value".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Value'", "Value", global::System.Management.Automation.CompletionResultType.ParameterValue, "Value"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SecureValue".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SecureValue'", "SecureValue", global::System.Management.Automation.CompletionResultType.ParameterValue, "SecureValue"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Credential".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Credential'", "Credential", global::System.Management.Automation.CompletionResultType.ParameterValue, "Credential"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.TypeConverter.cs deleted file mode 100644 index d859a07a7aa3..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.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.VMware.Support -{ - - /// The type of execution parameter - public partial class ScriptExecutionParameterTypeTypeConverter : - 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) => ScriptExecutionParameterType.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/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.cs deleted file mode 100644 index 95ea37ea31f8..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionParameterType.cs +++ /dev/null @@ -1,104 +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.VMware.Support -{ - - /// The type of execution parameter - public partial struct ScriptExecutionParameterType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Credential = @"Credential"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType SecureValue = @"SecureValue"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType Value = @"Value"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ScriptExecutionParameterType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScriptExecutionParameterType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScriptExecutionParameterType - /// 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.VMware.Support.ScriptExecutionParameterType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ScriptExecutionParameterType (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 ScriptExecutionParameterType && Equals((ScriptExecutionParameterType)obj); - } - - /// Returns hashCode for enum ScriptExecutionParameterType - /// 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 ScriptExecutionParameterType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScriptExecutionParameterType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScriptExecutionParameterType - /// the value to convert to an instance of . - - public static implicit operator ScriptExecutionParameterType(string value) - { - return new ScriptExecutionParameterType(value); - } - - /// Implicit operator to convert ScriptExecutionParameterType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType e) - { - return e._value; - } - - /// Overriding != operator for enum ScriptExecutionParameterType - /// 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.VMware.Support.ScriptExecutionParameterType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScriptExecutionParameterType - /// 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.VMware.Support.ScriptExecutionParameterType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionParameterType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.Completer.cs deleted file mode 100644 index 318e3a27cfd8..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.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.VMware.Support -{ - - /// The state of the script execution resource - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningStateTypeConverter))] - public partial struct ScriptExecutionProvisioningState : - 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) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelling".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelling'", "Cancelling", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelling"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cancelled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cancelled'", "Cancelled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cancelled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.TypeConverter.cs deleted file mode 100644 index c3687a3b0410..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.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.VMware.Support -{ - - /// The state of the script execution resource - public partial class ScriptExecutionProvisioningStateTypeConverter : - 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) => ScriptExecutionProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.cs deleted file mode 100644 index bcced3d52cb3..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptExecutionProvisioningState.cs +++ /dev/null @@ -1,114 +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.VMware.Support -{ - - /// The state of the script execution resource - public partial struct ScriptExecutionProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Cancelled = @"Cancelled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Cancelling = @"Cancelling"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Pending = @"Pending"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ScriptExecutionProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScriptExecutionProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScriptExecutionProvisioningState - /// 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.VMware.Support.ScriptExecutionProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ScriptExecutionProvisioningState (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 ScriptExecutionProvisioningState && Equals((ScriptExecutionProvisioningState)obj); - } - - /// Returns hashCode for enum ScriptExecutionProvisioningState - /// 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 ScriptExecutionProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScriptExecutionProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScriptExecutionProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ScriptExecutionProvisioningState(string value) - { - return new ScriptExecutionProvisioningState(value); - } - - /// Implicit operator to convert ScriptExecutionProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ScriptExecutionProvisioningState - /// 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.VMware.Support.ScriptExecutionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScriptExecutionProvisioningState - /// 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.VMware.Support.ScriptExecutionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptExecutionProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.Completer.cs deleted file mode 100644 index 5af3ed298d37..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.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.VMware.Support -{ - - /// Argument completer implementation for ScriptOutputStreamType. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamTypeTypeConverter))] - public partial struct ScriptOutputStreamType : - 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) || "Information".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Information'", "Information", global::System.Management.Automation.CompletionResultType.ParameterValue, "Information"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Warning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Warning'", "Warning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Warning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Output".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Output'", "Output", global::System.Management.Automation.CompletionResultType.ParameterValue, "Output"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.TypeConverter.cs deleted file mode 100644 index 7c74fb4ec68d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.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.VMware.Support -{ - - /// TypeConverter implementation for ScriptOutputStreamType. - public partial class ScriptOutputStreamTypeTypeConverter : - 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) => ScriptOutputStreamType.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/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.cs deleted file mode 100644 index 7b58e7626216..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptOutputStreamType.cs +++ /dev/null @@ -1,101 +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.VMware.Support -{ - - public partial struct ScriptOutputStreamType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType Information = @"Information"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType Output = @"Output"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType Warning = @"Warning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ScriptOutputStreamType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScriptOutputStreamType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScriptOutputStreamType - /// 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.VMware.Support.ScriptOutputStreamType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ScriptOutputStreamType (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 ScriptOutputStreamType && Equals((ScriptOutputStreamType)obj); - } - - /// Returns hashCode for enum ScriptOutputStreamType - /// 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 ScriptOutputStreamType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScriptOutputStreamType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScriptOutputStreamType - /// the value to convert to an instance of . - - public static implicit operator ScriptOutputStreamType(string value) - { - return new ScriptOutputStreamType(value); - } - - /// Implicit operator to convert ScriptOutputStreamType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType e) - { - return e._value; - } - - /// Overriding != operator for enum ScriptOutputStreamType - /// 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.VMware.Support.ScriptOutputStreamType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScriptOutputStreamType - /// 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.VMware.Support.ScriptOutputStreamType e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.Completer.cs deleted file mode 100644 index 2b6e286aaf59..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.Completer.cs +++ /dev/null @@ -1,57 +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.VMware.Support -{ - - /// - /// The type of parameter the script is expecting. psCredential is a PSCredentialObject - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypesTypeConverter))] - public partial struct ScriptParameterTypes : - 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) || "String".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'String'", "String", global::System.Management.Automation.CompletionResultType.ParameterValue, "String"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SecureString".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SecureString'", "SecureString", global::System.Management.Automation.CompletionResultType.ParameterValue, "SecureString"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Credential".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Credential'", "Credential", global::System.Management.Automation.CompletionResultType.ParameterValue, "Credential"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Int".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Int'", "Int", global::System.Management.Automation.CompletionResultType.ParameterValue, "Int"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Bool".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Bool'", "Bool", global::System.Management.Automation.CompletionResultType.ParameterValue, "Bool"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Float".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Float'", "Float", global::System.Management.Automation.CompletionResultType.ParameterValue, "Float"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.TypeConverter.cs deleted file mode 100644 index 54ccc4ffd650..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.TypeConverter.cs +++ /dev/null @@ -1,61 +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.VMware.Support -{ - - /// - /// The type of parameter the script is expecting. psCredential is a PSCredentialObject - /// - public partial class ScriptParameterTypesTypeConverter : - 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) => ScriptParameterTypes.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/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.cs b/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.cs deleted file mode 100644 index b8aa52288d62..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/ScriptParameterTypes.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.VMware.Support -{ - - /// - /// The type of parameter the script is expecting. psCredential is a PSCredentialObject - /// - public partial struct ScriptParameterTypes : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes Bool = @"Bool"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes Credential = @"Credential"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes Float = @"Float"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes Int = @"Int"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes SecureString = @"SecureString"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes String = @"String"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ScriptParameterTypes - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ScriptParameterTypes(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ScriptParameterTypes - /// 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.VMware.Support.ScriptParameterTypes e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ScriptParameterTypes (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 ScriptParameterTypes && Equals((ScriptParameterTypes)obj); - } - - /// Returns hashCode for enum ScriptParameterTypes - /// 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 ScriptParameterTypes(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ScriptParameterTypes - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ScriptParameterTypes - /// the value to convert to an instance of . - - public static implicit operator ScriptParameterTypes(string value) - { - return new ScriptParameterTypes(value); - } - - /// Implicit operator to convert ScriptParameterTypes to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes e) - { - return e._value; - } - - /// Overriding != operator for enum ScriptParameterTypes - /// 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.VMware.Support.ScriptParameterTypes e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ScriptParameterTypes - /// 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.VMware.Support.ScriptParameterTypes e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptParameterTypes e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.Completer.cs deleted file mode 100644 index 9906b7785f07..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.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.VMware.Support -{ - - /// Segment status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnumTypeConverter))] - public partial struct SegmentStatusEnum : - 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) || "SUCCESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SUCCESS'", "SUCCESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "SUCCESS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILURE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FAILURE'", "FAILURE", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILURE"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.TypeConverter.cs deleted file mode 100644 index 5b948dffd33c..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.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.VMware.Support -{ - - /// Segment status. - public partial class SegmentStatusEnumTypeConverter : - 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) => SegmentStatusEnum.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/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.cs deleted file mode 100644 index 44a92972fbf8..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/SegmentStatusEnum.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.VMware.Support -{ - - /// Segment status. - public partial struct SegmentStatusEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum Failure = @"FAILURE"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum Success = @"SUCCESS"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SegmentStatusEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SegmentStatusEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SegmentStatusEnum - /// 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.VMware.Support.SegmentStatusEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SegmentStatusEnum (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 SegmentStatusEnum && Equals((SegmentStatusEnum)obj); - } - - /// Returns hashCode for enum SegmentStatusEnum - /// 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 SegmentStatusEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SegmentStatusEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SegmentStatusEnum - /// the value to convert to an instance of . - - public static implicit operator SegmentStatusEnum(string value) - { - return new SegmentStatusEnum(value); - } - - /// Implicit operator to convert SegmentStatusEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum e) - { - return e._value; - } - - /// Overriding != operator for enum SegmentStatusEnum - /// 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.VMware.Support.SegmentStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SegmentStatusEnum - /// 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.VMware.Support.SegmentStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SegmentStatusEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.Completer.cs deleted file mode 100644 index eb3066109523..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.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.VMware.Support -{ - - /// Protect LDAP communication using SSL certificate (LDAPS) - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnumTypeConverter))] - public partial struct SslEnum : - 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) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.TypeConverter.cs deleted file mode 100644 index ef3959fa6b0d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.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.VMware.Support -{ - - /// Protect LDAP communication using SSL certificate (LDAPS) - public partial class SslEnumTypeConverter : - 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) => SslEnum.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/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.cs deleted file mode 100644 index 62ccd8a6708d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/SslEnum.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.VMware.Support -{ - - /// Protect LDAP communication using SSL certificate (LDAPS) - public partial struct SslEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum Enabled = @"Enabled"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SslEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SslEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SslEnum - /// 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.VMware.Support.SslEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SslEnum (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 SslEnum && Equals((SslEnum)obj); - } - - /// Returns hashCode for enum SslEnum - /// 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 SslEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SslEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SslEnum - /// the value to convert to an instance of . - - public static implicit operator SslEnum(string value) - { - return new SslEnum(value); - } - - /// Implicit operator to convert SslEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum e) - { - return e._value; - } - - /// Overriding != operator for enum SslEnum - /// 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.VMware.Support.SslEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SslEnum - /// 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.VMware.Support.SslEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.SslEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.Completer.cs deleted file mode 100644 index 23d9530bdc4b..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.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.VMware.Support -{ - - /// Trial status - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatusTypeConverter))] - public partial struct TrialStatus : - 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) || "TrialAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TrialAvailable'", "TrialAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "TrialAvailable"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TrialUsed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TrialUsed'", "TrialUsed", global::System.Management.Automation.CompletionResultType.ParameterValue, "TrialUsed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "TrialDisabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'TrialDisabled'", "TrialDisabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "TrialDisabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.TypeConverter.cs deleted file mode 100644 index 7e693e5a9781..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.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.VMware.Support -{ - - /// Trial status - public partial class TrialStatusTypeConverter : - 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) => TrialStatus.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/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.cs b/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.cs deleted file mode 100644 index e0faed37f692..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/TrialStatus.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.VMware.Support -{ - - /// Trial status - public partial struct TrialStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus TrialAvailable = @"TrialAvailable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus TrialDisabled = @"TrialDisabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus TrialUsed = @"TrialUsed"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to TrialStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TrialStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TrialStatus - /// 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.VMware.Support.TrialStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TrialStatus (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 TrialStatus && Equals((TrialStatus)obj); - } - - /// Returns hashCode for enum TrialStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for TrialStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private TrialStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to TrialStatus - /// the value to convert to an instance of . - - public static implicit operator TrialStatus(string value) - { - return new TrialStatus(value); - } - - /// Implicit operator to convert TrialStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus e) - { - return e._value; - } - - /// Overriding != operator for enum TrialStatus - /// 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.VMware.Support.TrialStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TrialStatus - /// 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.VMware.Support.TrialStatus e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.TrialStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.Completer.cs deleted file mode 100644 index 5c6b33b8555f..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.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.VMware.Support -{ - - /// VM Group status. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnumTypeConverter))] - public partial struct VMGroupStatusEnum : - 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) || "SUCCESS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SUCCESS'", "SUCCESS", global::System.Management.Automation.CompletionResultType.ParameterValue, "SUCCESS"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "FAILURE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'FAILURE'", "FAILURE", global::System.Management.Automation.CompletionResultType.ParameterValue, "FAILURE"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.TypeConverter.cs deleted file mode 100644 index 82cac5eaec00..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.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.VMware.Support -{ - - /// VM Group status. - public partial class VMGroupStatusEnumTypeConverter : - 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) => VMGroupStatusEnum.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/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.cs deleted file mode 100644 index 50bf41bbeb21..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VMGroupStatusEnum.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.VMware.Support -{ - - /// VM Group status. - public partial struct VMGroupStatusEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum Failure = @"FAILURE"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum Success = @"SUCCESS"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VMGroupStatusEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VMGroupStatusEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VMGroupStatusEnum - /// 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.VMware.Support.VMGroupStatusEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VMGroupStatusEnum (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 VMGroupStatusEnum && Equals((VMGroupStatusEnum)obj); - } - - /// Returns hashCode for enum VMGroupStatusEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VMGroupStatusEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private VMGroupStatusEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VMGroupStatusEnum - /// the value to convert to an instance of . - - public static implicit operator VMGroupStatusEnum(string value) - { - return new VMGroupStatusEnum(value); - } - - /// Implicit operator to convert VMGroupStatusEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum e) - { - return e._value; - } - - /// Overriding != operator for enum VMGroupStatusEnum - /// 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.VMware.Support.VMGroupStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VMGroupStatusEnum - /// 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.VMware.Support.VMGroupStatusEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMGroupStatusEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.Completer.cs deleted file mode 100644 index c288aa2d1982..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.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.VMware.Support -{ - - /// Virtual machine type. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnumTypeConverter))] - public partial struct VMTypeEnum : - 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) || "REGULAR".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'REGULAR'", "REGULAR", global::System.Management.Automation.CompletionResultType.ParameterValue, "REGULAR"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "EDGE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'EDGE'", "EDGE", global::System.Management.Automation.CompletionResultType.ParameterValue, "EDGE"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SERVICE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SERVICE'", "SERVICE", global::System.Management.Automation.CompletionResultType.ParameterValue, "SERVICE"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.TypeConverter.cs deleted file mode 100644 index c85a74b8bbe0..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.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.VMware.Support -{ - - /// Virtual machine type. - public partial class VMTypeEnumTypeConverter : - 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) => VMTypeEnum.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/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.cs deleted file mode 100644 index a95b68d67d7d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VMTypeEnum.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.VMware.Support -{ - - /// Virtual machine type. - public partial struct VMTypeEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum Edge = @"EDGE"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum Regular = @"REGULAR"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum Service = @"SERVICE"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VMTypeEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VMTypeEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VMTypeEnum - /// 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.VMware.Support.VMTypeEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VMTypeEnum (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 VMTypeEnum && Equals((VMTypeEnum)obj); - } - - /// Returns hashCode for enum VMTypeEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VMTypeEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private VMTypeEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VMTypeEnum - /// the value to convert to an instance of . - - public static implicit operator VMTypeEnum(string value) - { - return new VMTypeEnum(value); - } - - /// Implicit operator to convert VMTypeEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum e) - { - return e._value; - } - - /// Overriding != operator for enum VMTypeEnum - /// 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.VMware.Support.VMTypeEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VMTypeEnum - /// 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.VMware.Support.VMTypeEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VMTypeEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.Completer.cs deleted file mode 100644 index 7d56966fa5ee..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.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.VMware.Support -{ - - /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementStateTypeConverter))] - public partial struct VirtualMachineRestrictMovementState : - 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) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.TypeConverter.cs deleted file mode 100644 index 1428cf1b6768..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.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.VMware.Support -{ - - /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) - public partial class VirtualMachineRestrictMovementStateTypeConverter : - 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) => VirtualMachineRestrictMovementState.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/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.cs b/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.cs deleted file mode 100644 index 3cccc4b87f97..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VirtualMachineRestrictMovementState.cs +++ /dev/null @@ -1,104 +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.VMware.Support -{ - - /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) - public partial struct VirtualMachineRestrictMovementState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState Enabled = @"Enabled"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineRestrictMovementState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineRestrictMovementState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineRestrictMovementState - /// 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.VMware.Support.VirtualMachineRestrictMovementState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineRestrictMovementState (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 VirtualMachineRestrictMovementState && Equals((VirtualMachineRestrictMovementState)obj); - } - - /// Returns hashCode for enum VirtualMachineRestrictMovementState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineRestrictMovementState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private VirtualMachineRestrictMovementState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineRestrictMovementState - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineRestrictMovementState(string value) - { - return new VirtualMachineRestrictMovementState(value); - } - - /// Implicit operator to convert VirtualMachineRestrictMovementState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineRestrictMovementState - /// 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.VMware.Support.VirtualMachineRestrictMovementState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineRestrictMovementState - /// 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.VMware.Support.VirtualMachineRestrictMovementState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.Completer.cs deleted file mode 100644 index d9a972a237bf..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.Completer.cs +++ /dev/null @@ -1,41 +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.VMware.Support -{ - - /// - /// Should this parameter be visible to arm and passed in the parameters argument when executing - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnumTypeConverter))] - public partial struct VisibilityParameterEnum : - 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) || "Visible".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Visible'", "Visible", global::System.Management.Automation.CompletionResultType.ParameterValue, "Visible"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Hidden".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Hidden'", "Hidden", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hidden"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.TypeConverter.cs deleted file mode 100644 index 08229b7e3259..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.TypeConverter.cs +++ /dev/null @@ -1,61 +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.VMware.Support -{ - - /// - /// Should this parameter be visible to arm and passed in the parameters argument when executing - /// - public partial class VisibilityParameterEnumTypeConverter : - 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) => VisibilityParameterEnum.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/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.cs b/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.cs deleted file mode 100644 index 9a5466c79028..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/VisibilityParameterEnum.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.VMware.Support -{ - - /// - /// Should this parameter be visible to arm and passed in the parameters argument when executing - /// - public partial struct VisibilityParameterEnum : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum Hidden = @"Hidden"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum Visible = @"Visible"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VisibilityParameterEnum - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VisibilityParameterEnum(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VisibilityParameterEnum - /// 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.VMware.Support.VisibilityParameterEnum e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VisibilityParameterEnum (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 VisibilityParameterEnum && Equals((VisibilityParameterEnum)obj); - } - - /// Returns hashCode for enum VisibilityParameterEnum - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VisibilityParameterEnum - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private VisibilityParameterEnum(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VisibilityParameterEnum - /// the value to convert to an instance of . - - public static implicit operator VisibilityParameterEnum(string value) - { - return new VisibilityParameterEnum(value); - } - - /// Implicit operator to convert VisibilityParameterEnum to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum e) - { - return e._value; - } - - /// Overriding != operator for enum VisibilityParameterEnum - /// 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.VMware.Support.VisibilityParameterEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VisibilityParameterEnum - /// 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.VMware.Support.VisibilityParameterEnum e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VisibilityParameterEnum e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.Completer.cs deleted file mode 100644 index e290f18a31eb..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkDhcpProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.TypeConverter.cs deleted file mode 100644 index 884d51ae509d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkDhcpProvisioningStateTypeConverter : - 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) => WorkloadNetworkDhcpProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.cs deleted file mode 100644 index 94e7e1cf6485..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDhcpProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkDhcpProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadNetworkDhcpProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkDhcpProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkDhcpProvisioningState - /// 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.VMware.Support.WorkloadNetworkDhcpProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkDhcpProvisioningState (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 WorkloadNetworkDhcpProvisioningState && Equals((WorkloadNetworkDhcpProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkDhcpProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkDhcpProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkDhcpProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkloadNetworkDhcpProvisioningState - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkDhcpProvisioningState(string value) - { - return new WorkloadNetworkDhcpProvisioningState(value); - } - - /// Implicit operator to convert WorkloadNetworkDhcpProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkDhcpProvisioningState - /// 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.VMware.Support.WorkloadNetworkDhcpProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkDhcpProvisioningState - /// 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.VMware.Support.WorkloadNetworkDhcpProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDhcpProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.Completer.cs deleted file mode 100644 index 0a70c8db7d28..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkDnsServiceProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.TypeConverter.cs deleted file mode 100644 index bbd0ef169696..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkDnsServiceProvisioningStateTypeConverter : - 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) => WorkloadNetworkDnsServiceProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.cs deleted file mode 100644 index 7ed9d17b7746..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsServiceProvisioningState.cs +++ /dev/null @@ -1,114 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkDnsServiceProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadNetworkDnsServiceProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkDnsServiceProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkDnsServiceProvisioningState - /// 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.VMware.Support.WorkloadNetworkDnsServiceProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkDnsServiceProvisioningState (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 WorkloadNetworkDnsServiceProvisioningState && Equals((WorkloadNetworkDnsServiceProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkDnsServiceProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkDnsServiceProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkDnsServiceProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Implicit operator to convert string to WorkloadNetworkDnsServiceProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkDnsServiceProvisioningState(string value) - { - return new WorkloadNetworkDnsServiceProvisioningState(value); - } - - /// - /// Implicit operator to convert WorkloadNetworkDnsServiceProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkDnsServiceProvisioningState - /// 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.VMware.Support.WorkloadNetworkDnsServiceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkDnsServiceProvisioningState - /// 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.VMware.Support.WorkloadNetworkDnsServiceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsServiceProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.Completer.cs deleted file mode 100644 index 5f36c2b17265..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkDnsZoneProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.TypeConverter.cs deleted file mode 100644 index 6432ab19c336..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkDnsZoneProvisioningStateTypeConverter : - 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) => WorkloadNetworkDnsZoneProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.cs deleted file mode 100644 index b8f4a0bc398c..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkDnsZoneProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkDnsZoneProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadNetworkDnsZoneProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkDnsZoneProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkDnsZoneProvisioningState - /// 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.VMware.Support.WorkloadNetworkDnsZoneProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkDnsZoneProvisioningState (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 WorkloadNetworkDnsZoneProvisioningState && Equals((WorkloadNetworkDnsZoneProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkDnsZoneProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkDnsZoneProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkDnsZoneProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkloadNetworkDnsZoneProvisioningState - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkDnsZoneProvisioningState(string value) - { - return new WorkloadNetworkDnsZoneProvisioningState(value); - } - - /// Implicit operator to convert WorkloadNetworkDnsZoneProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkDnsZoneProvisioningState - /// 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.VMware.Support.WorkloadNetworkDnsZoneProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkDnsZoneProvisioningState - /// 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.VMware.Support.WorkloadNetworkDnsZoneProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkDnsZoneProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.Completer.cs deleted file mode 100644 index 14f85d5f9803..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkPortMirroringProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.TypeConverter.cs deleted file mode 100644 index a41339dbcb7d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkPortMirroringProvisioningStateTypeConverter : - 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) => WorkloadNetworkPortMirroringProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.cs deleted file mode 100644 index c79feb6b46f0..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPortMirroringProvisioningState.cs +++ /dev/null @@ -1,116 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkPortMirroringProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// - /// Conversion from arbitrary object to WorkloadNetworkPortMirroringProvisioningState - /// - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkPortMirroringProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkPortMirroringProvisioningState - /// 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.VMware.Support.WorkloadNetworkPortMirroringProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkPortMirroringProvisioningState (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 WorkloadNetworkPortMirroringProvisioningState && Equals((WorkloadNetworkPortMirroringProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkPortMirroringProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkPortMirroringProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkPortMirroringProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Implicit operator to convert string to WorkloadNetworkPortMirroringProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkPortMirroringProvisioningState(string value) - { - return new WorkloadNetworkPortMirroringProvisioningState(value); - } - - /// - /// Implicit operator to convert WorkloadNetworkPortMirroringProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkPortMirroringProvisioningState - /// 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.VMware.Support.WorkloadNetworkPortMirroringProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkPortMirroringProvisioningState - /// 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.VMware.Support.WorkloadNetworkPortMirroringProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPortMirroringProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.Completer.cs deleted file mode 100644 index 9d1061b14585..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkPublicIPProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.TypeConverter.cs deleted file mode 100644 index 6a5edc78418e..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkPublicIPProvisioningStateTypeConverter : - 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) => WorkloadNetworkPublicIPProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.cs deleted file mode 100644 index 1de0aa6282fd..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkPublicIPProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkPublicIPProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadNetworkPublicIPProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkPublicIPProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkPublicIPProvisioningState - /// 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.VMware.Support.WorkloadNetworkPublicIPProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkPublicIPProvisioningState (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 WorkloadNetworkPublicIPProvisioningState && Equals((WorkloadNetworkPublicIPProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkPublicIPProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkPublicIPProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkPublicIPProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkloadNetworkPublicIPProvisioningState - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkPublicIPProvisioningState(string value) - { - return new WorkloadNetworkPublicIPProvisioningState(value); - } - - /// Implicit operator to convert WorkloadNetworkPublicIPProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkPublicIPProvisioningState - /// 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.VMware.Support.WorkloadNetworkPublicIPProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkPublicIPProvisioningState - /// 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.VMware.Support.WorkloadNetworkPublicIPProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkPublicIPProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.Completer.cs deleted file mode 100644 index a6648f2eba5d..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkSegmentProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.TypeConverter.cs deleted file mode 100644 index 82a6b5441f3a..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkSegmentProvisioningStateTypeConverter : - 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) => WorkloadNetworkSegmentProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.cs deleted file mode 100644 index eb1cc6f9edda..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkSegmentProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkSegmentProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadNetworkSegmentProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkSegmentProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkSegmentProvisioningState - /// 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.VMware.Support.WorkloadNetworkSegmentProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkSegmentProvisioningState (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 WorkloadNetworkSegmentProvisioningState && Equals((WorkloadNetworkSegmentProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkSegmentProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkSegmentProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkSegmentProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkloadNetworkSegmentProvisioningState - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkSegmentProvisioningState(string value) - { - return new WorkloadNetworkSegmentProvisioningState(value); - } - - /// Implicit operator to convert WorkloadNetworkSegmentProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkSegmentProvisioningState - /// 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.VMware.Support.WorkloadNetworkSegmentProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkSegmentProvisioningState - /// 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.VMware.Support.WorkloadNetworkSegmentProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkSegmentProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.Completer.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.Completer.cs deleted file mode 100644 index 473e18a2341f..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.Completer.cs +++ /dev/null @@ -1,51 +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.VMware.Support -{ - - /// The provisioning state - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningStateTypeConverter))] - public partial struct WorkloadNetworkVMGroupProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Building".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Building'", "Building", global::System.Management.Automation.CompletionResultType.ParameterValue, "Building"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.TypeConverter.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.TypeConverter.cs deleted file mode 100644 index 9e3de2482f70..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.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.VMware.Support -{ - - /// The provisioning state - public partial class WorkloadNetworkVMGroupProvisioningStateTypeConverter : - 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) => WorkloadNetworkVMGroupProvisioningState.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/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.cs b/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.cs deleted file mode 100644 index 01909cffb005..000000000000 --- a/src/VMware/VMware.Autorest/generated/api/Support/WorkloadNetworkVMGroupProvisioningState.cs +++ /dev/null @@ -1,110 +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.VMware.Support -{ - - /// The provisioning state - public partial struct WorkloadNetworkVMGroupProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState Building = @"Building"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadNetworkVMGroupProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadNetworkVMGroupProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadNetworkVMGroupProvisioningState - /// 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.VMware.Support.WorkloadNetworkVMGroupProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type WorkloadNetworkVMGroupProvisioningState (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 WorkloadNetworkVMGroupProvisioningState && Equals((WorkloadNetworkVMGroupProvisioningState)obj); - } - - /// Returns hashCode for enum WorkloadNetworkVMGroupProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadNetworkVMGroupProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private WorkloadNetworkVMGroupProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkloadNetworkVMGroupProvisioningState - /// the value to convert to an instance of . - - public static implicit operator WorkloadNetworkVMGroupProvisioningState(string value) - { - return new WorkloadNetworkVMGroupProvisioningState(value); - } - - /// Implicit operator to convert WorkloadNetworkVMGroupProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadNetworkVMGroupProvisioningState - /// 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.VMware.Support.WorkloadNetworkVMGroupProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadNetworkVMGroupProvisioningState - /// 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.VMware.Support.WorkloadNetworkVMGroupProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.WorkloadNetworkVMGroupProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/api/VMware.cs b/src/VMware/VMware.Autorest/generated/api/VMware.cs index d4badc7a050b..293f77e15e1f 100644 --- a/src/VMware/VMware.Autorest/generated/api/VMware.cs +++ b/src/VMware/VMware.Autorest/generated/api/VMware.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware public partial class VMware { - /// Create or update a addon in a private cloud + /// Create a addon in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the private cloud. @@ -25,12 +25,13 @@ public partial class VMware /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -57,15 +58,15 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AddonsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a addon in a private cloud + /// Create a addon in a private cloud /// /// A addon in the private cloud /// a delegate that is called when the remote service returns 200 (OK). @@ -73,12 +74,13 @@ public partial class VMware /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -118,15 +120,276 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AddonsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Create a addon in a private cloud + /// + /// A addon in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/addons/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/addons/{addonName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var addonName = _match.Groups["addonName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/addons/" + + addonName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AddonsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create a addon in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the addon for the private cloud + /// A addon in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/addons/" + + global::System.Uri.EscapeDataString(addonName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AddonsCreateOrUpdateWithResult_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.VMware.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 AddonsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -136,7 +399,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AddonsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AddonsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -145,6 +408,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -154,13 +418,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -174,10 +433,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -186,45 +441,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -246,6 +501,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -253,13 +509,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -287,7 +543,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AddonsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AddonsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -298,6 +554,7 @@ public partial class VMware await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); await eventListener.AssertNotNull(nameof(addonName),addonName); + await eventListener.AssertRegEx(nameof(addonName), addonName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -317,9 +574,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AddonsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -346,7 +603,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AddonsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -361,9 +618,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AddonsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -403,11 +660,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AddonsDelete_Call (request, onOk,onNoContent,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 204 (NoContent). @@ -418,7 +675,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AddonsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AddonsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -427,6 +684,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -437,13 +695,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -457,10 +710,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -469,45 +718,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -529,6 +778,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -548,7 +798,7 @@ public partial class VMware default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -585,7 +835,9 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(addonName),addonName); + await eventListener.AssertRegEx(nameof(addonName), addonName, @"^[-\w\._]+$"); } } @@ -602,9 +854,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AddonsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -631,7 +883,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AddonsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -645,9 +897,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AddonsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -687,62 +939,221 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AddonsGet_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). + /// Get an addon by name in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/addons/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var addonName = _match.Groups["addonName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/addons/" + + addonName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AddonsGetWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Get an addon by name in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the addon for the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string addonName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/addons/" + + global::System.Uri.EscapeDataString(addonName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AddonsGetWithResult_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.VMware.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 AddonsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 AddonsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -762,7 +1173,9 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(addonName),addonName); + await eventListener.AssertRegEx(nameof(addonName), addonName, @"^[-\w\._]+$"); } } @@ -778,9 +1191,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AddonsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -806,7 +1219,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsList_Call(request,onOk,onDefault,eventListener,sender); + await this.AddonsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -820,9 +1233,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AddonsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AddonsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -860,11 +1273,165 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AddonsList_Call(request,onOk,onDefault,eventListener,sender); + await this.AddonsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List addons in a private cloud + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/addons$", 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.AVS/privateClouds/{privateCloudName}/addons'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/addons" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AddonsListWithResult_Call (request, eventListener,sender); + } + } + + /// List addons in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AddonsListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/addons" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AddonsListWithResult_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.VMware.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 AddonsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -874,7 +1441,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AddonsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AddonsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -885,6 +1452,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -892,13 +1460,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AddonList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -934,10 +1502,11 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create an ExpressRoute Circuit Authorization in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the private cloud. @@ -948,12 +1517,13 @@ public partial class VMware /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -980,15 +1550,15 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AuthorizationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AuthorizationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create an ExpressRoute Circuit Authorization in a private cloud /// /// An ExpressRoute Circuit Authorization /// a delegate that is called when the remote service returns 200 (OK). @@ -996,12 +1566,13 @@ public partial class VMware /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1041,49 +1612,308 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AuthorizationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AuthorizationsCreateOrUpdate_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). + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// + /// An ExpressRoute Circuit Authorization /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/authorizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var authorizationName = _match.Groups["authorizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/authorizations/" + + authorizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AuthorizationsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the ExpressRoute Circuit Authorization in the private cloud + /// An ExpressRoute Circuit Authorization + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AuthorizationsCreateOrUpdateWithResult_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.VMware.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 AuthorizationsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + /// 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.VMware.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 AuthorizationsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1097,10 +1927,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -1109,45 +1935,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1169,6 +1995,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1176,13 +2003,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1210,7 +2037,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AuthorizationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AuthorizationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1221,6 +2048,7 @@ public partial class VMware await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); await eventListener.AssertNotNull(nameof(authorizationName),authorizationName); + await eventListener.AssertRegEx(nameof(authorizationName), authorizationName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -1240,9 +2068,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AuthorizationsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1269,7 +2097,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AuthorizationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AuthorizationsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -1284,9 +2112,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AuthorizationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1326,11 +2154,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AuthorizationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AuthorizationsDelete_Call (request, onOk,onNoContent,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 204 (NoContent). @@ -1341,7 +2169,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AuthorizationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AuthorizationsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1350,6 +2178,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -1360,13 +2189,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1380,10 +2204,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -1392,45 +2212,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1452,6 +2272,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1471,7 +2292,7 @@ public partial class VMware default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1508,7 +2329,9 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(authorizationName),authorizationName); + await eventListener.AssertRegEx(nameof(authorizationName), authorizationName, @"^[-\w\._]+$"); } } @@ -1525,9 +2348,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AuthorizationsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1554,7 +2377,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AuthorizationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AuthorizationsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1568,9 +2391,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AuthorizationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1610,100 +2433,78 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AuthorizationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AuthorizationsGet_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). + /// Get an ExpressRoute Circuit Authorization by name in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/authorizations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the ExpressRoute Circuit Authorization in the private cloud - /// 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 AuthorizationsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(authorizationName),authorizationName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var authorizationName = _match.Groups["authorizationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/authorizations/" + + authorizationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AuthorizationsGetWithResult_Call (request, eventListener,sender); } } - /// List ExpressRoute Circuit Authorizations in a private cloud + /// Get an ExpressRoute Circuit Authorization by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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). + /// Name of the ExpressRoute Circuit Authorization in the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1715,79 +2516,86 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/authorizations" + + "/authorizations/" + + global::System.Uri.EscapeDataString(authorizationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.AuthorizationsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.AuthorizationsGetWithResult_Call (request, eventListener,sender); } } - /// List ExpressRoute Circuit Authorizations in a private cloud - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AuthorizationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/authorizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/authorizations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.AuthorizationsList_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 @@ -1797,7 +2605,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AuthorizationsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AuthorizationsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1808,6 +2616,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1815,13 +2624,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorizationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1837,17 +2646,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the ExpressRoute Circuit Authorization in the private cloud /// 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 AuthorizationsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AuthorizationsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string authorizationName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1857,15 +2667,16 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(authorizationName),authorizationName); + await eventListener.AssertRegEx(nameof(authorizationName), authorizationName, @"^[-\w\._]+$"); } } - /// Create or update a cloud link in a private cloud + /// List ExpressRoute Circuit Authorizations in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the cloud link resource - /// A cloud link in the private cloud + /// Name of the private cloud /// 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). @@ -1874,9 +2685,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -1888,8 +2699,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/cloudLinks/" - + global::System.Uri.EscapeDataString(cloudLinkName) + + "/authorizations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1898,22 +2708,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudLinksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AuthorizationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a cloud link in a private cloud + /// List ExpressRoute Circuit Authorizations in a private cloud /// - /// A cloud link in the private cloud /// 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). @@ -1922,25 +2727,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/cloudLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/authorizations$", 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.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var cloudLinkName = _match.Groups["cloudLinkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -1949,8 +2753,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/cloudLinks/" - + cloudLinkName + + "/authorizations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1959,139 +2762,191 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudLinksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AuthorizationsList_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). + /// List ExpressRoute Circuit Authorizations in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 CloudLinksCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AuthorizationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/authorizations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/authorizations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AuthorizationsListWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// List ExpressRoute Circuit Authorizations in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/authorizations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AuthorizationsListWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 AuthorizationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 AuthorizationsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2099,13 +2954,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorizationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2121,19 +2976,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the cloud link resource - /// A cloud link in the private cloud + /// Name of the private cloud /// 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 CloudLinksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AuthorizationsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2143,29 +2996,28 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(cloudLinkName),cloudLinkName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Delete a cloud link in a private cloud + /// Create a cloud link in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// The name of the private cloud. /// Name of the cloud link resource + /// A cloud link in the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// 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.VMware.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 CloudLinksDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2187,29 +3039,34 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudLinksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.CloudLinksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a cloud link in a private cloud + /// Create a cloud link in a private cloud /// + /// A cloud link in the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// 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.VMware.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 CloudLinksDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2244,27 +3101,138 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CloudLinksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a cloud link in a private cloud + /// + /// A cloud link in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 CloudLinksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/cloudLinks/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var cloudLinkName = _match.Groups["cloudLinkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/cloudLinks/" + + cloudLinkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudLinksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create a cloud link in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the cloud link resource + /// A cloud link in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 CloudLinksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/cloudLinks/" + + global::System.Uri.EscapeDataString(cloudLinkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.CloudLinksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.CloudLinksCreateOrUpdateWithResult_Call (request, 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 204 (NoContent). - /// 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.VMware.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 CloudLinksDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2272,24 +3240,19 @@ public partial class VMware try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -2303,57 +3266,53 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -2361,41 +3320,48 @@ public partial class VMware continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + if (!string.IsNullOrWhiteSpace(_originalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); // drop the old response _response?.Dispose(); // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -2409,37 +3375,8 @@ public partial class VMware } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cloud link resource - /// 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 CloudLinksDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(cloudLinkName),cloudLinkName); - } - } - - /// Get an cloud link by name in a private cloud - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cloud link resource + /// 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). @@ -2448,116 +3385,109 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudLinksGet(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/cloudLinks/" - + global::System.Uri.EscapeDataString(cloudLinkName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.CloudLinksGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - /// Get an cloud link by name in a private cloud - /// - /// 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.VMware.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 CloudLinksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri + // drop the old response + _response?.Dispose(); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/cloudLinks/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}'"); - } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var cloudLinkName = _match.Groups["cloudLinkName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/cloudLinks/" - + cloudLinkName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } - // 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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.CloudLinksGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + // drop the old response + _response?.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.VMware.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 CloudLinksGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2565,13 +3495,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2587,18 +3517,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// The name of the private cloud. /// Name of the cloud link resource + /// A cloud link in the private cloud /// 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 CloudLinksGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudLinksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2609,14 +3540,19 @@ public partial class VMware await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); await eventListener.AssertNotNull(nameof(cloudLinkName),cloudLinkName); + await eventListener.AssertRegEx(nameof(cloudLinkName), cloudLinkName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// List cloud link in a private cloud + /// Delete a cloud link in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the cloud link resource /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2624,9 +3560,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudLinksList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2638,7 +3574,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/cloudLinks" + + "/cloudLinks/" + + global::System.Uri.EscapeDataString(cloudLinkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2647,18 +3584,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudLinksList_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudLinksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// List cloud link in a private cloud + /// Delete a cloud link in a private cloud /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2666,24 +3604,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudLinksListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/cloudLinks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/cloudLinks/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/cloudLinks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var cloudLinkName = _match.Groups["cloudLinkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2692,7 +3631,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/cloudLinks" + + "/cloudLinks/" + + cloudLinkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2701,18 +3641,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudLinksList_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudLinksDelete_Call (request, onOk,onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -2720,7 +3661,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudLinksList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudLinksDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2729,8 +3670,101 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2738,13 +3772,19 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLinkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2760,17 +3800,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the cloud link resource /// 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 CloudLinksList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudLinksDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2780,15 +3821,17 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(cloudLinkName),cloudLinkName); + await eventListener.AssertRegEx(nameof(cloudLinkName), cloudLinkName, @"^[-\w\._]+$"); } } - /// Create or update a cluster in a private cloud + /// Get an cloud link by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the cluster in the private cloud - /// A cluster in the private cloud + /// Name of the private cloud + /// Name of the cloud link resource /// 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). @@ -2797,9 +3840,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksGet(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -2811,8 +3854,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/cloudLinks/" + + global::System.Uri.EscapeDataString(cloudLinkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2821,22 +3864,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudLinksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a cluster in a private cloud + /// Get an cloud link by name in a private cloud /// - /// A cluster in the private cloud /// 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). @@ -2845,25 +3883,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/cloudLinks/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; + var cloudLinkName = _match.Groups["cloudLinkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -2872,8 +3910,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName + + "/cloudLinks/" + + cloudLinkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -2882,139 +3920,195 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudLinksGet_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). + /// Get an cloud link by name in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ClustersCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/cloudLinks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var cloudLinkName = _match.Groups["cloudLinkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/cloudLinks/" + + cloudLinkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudLinksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get an cloud link by name in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cloud link resource + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 CloudLinksGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/cloudLinks/" + + global::System.Uri.EscapeDataString(cloudLinkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudLinksGetWithResult_Call (request, eventListener,sender); + } + } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 CloudLinksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 CloudLinksGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3022,13 +4116,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3044,19 +4138,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the cluster in the private cloud - /// A cluster in the private cloud + /// Name of the private cloud + /// Name of the cloud link resource /// 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 ClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudLinksGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string cloudLinkName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3066,19 +4159,17 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(cloudLinkName),cloudLinkName); + await eventListener.AssertRegEx(nameof(cloudLinkName), cloudLinkName, @"^[-\w\._]+$"); } } - /// Delete a cluster in a private cloud + /// List cloud link in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3086,9 +4177,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3100,8 +4191,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/cloudLinks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3110,19 +4200,18 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.CloudLinksList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a cluster in a private cloud + /// List cloud link in a private cloud /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -3130,25 +4219,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/cloudLinks$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3157,8 +4245,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName + + "/cloudLinks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3167,213 +4254,80 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.CloudLinksList_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// List cloud link in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ClustersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/cloudLinks$", 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.AVS/privateClouds/{privateCloudName}/cloudLinks'"); + } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/cloudLinks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for cancellation - 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudLinksListWithResult_Call (request, eventListener,sender); + } + } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// 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 ClustersDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - } - } - - /// Get a cluster by name in a private cloud + /// List cloud link in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// 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.VMware.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 ClustersGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudLinksListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3385,82 +4339,85 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/cloudLinks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.CloudLinksListWithResult_Call (request, eventListener,sender); } } - /// Get a cluster by name in a private cloud - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudLinksListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/clusters/" - + clusterName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ClustersGet_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 @@ -3470,7 +4427,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudLinksList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3481,6 +4438,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3488,13 +4446,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLinkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3510,18 +4468,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud /// 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 ClustersGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudLinksList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3531,25 +4488,28 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// List clusters in a private cloud + /// Create a cluster in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// The name of the private cloud. + /// Name of the cluster in the private cloud + /// A cluster in the private cloud /// 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.VMware.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 ClustersList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3561,7 +4521,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters" + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3570,43 +4531,50 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersList_Call(request,onOk,onDefault,eventListener,sender); + await this.ClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// List clusters in a private cloud + /// Create a cluster in a private cloud /// + /// A cluster in the private cloud /// 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.VMware.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 ClustersListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -3615,7 +4583,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters" + + "/clusters/" + + clusterName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -3624,105 +4593,95 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersList_Call(request,onOk,onDefault,eventListener,sender); + await this.ClustersCreateOrUpdate_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). + /// Create a cluster in a private cloud + /// + /// A cluster in the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ClustersList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 ClustersList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Update a cluster in a private cloud + /// Create a cluster in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// The name of the private cloud. /// Name of the cluster in the private cloud - /// The cluster properties to be updated - /// 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). + /// A cluster in the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ClustersUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -3740,85 +4699,175 @@ public partial class VMware + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClustersCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Update a cluster in a private cloud - /// - /// The cluster properties to be updated - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ClustersUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/clusters/" - + clusterName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // 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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ClustersUpdate_Call(request,onOk,onDefault,eventListener,sender); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -3828,7 +4877,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3837,6 +4886,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -3846,13 +4896,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3866,10 +4911,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -3878,45 +4919,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3938,6 +4979,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3945,13 +4987,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3967,19 +5009,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// The name of the private cloud. /// Name of the cluster in the private cloud - /// The cluster properties to be updated + /// A cluster in the private cloud /// 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 ClustersUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3990,19 +5032,19 @@ public partial class VMware await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create or update a datastore in a private cloud cluster + /// Delete a cluster in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Name of the datastore in the private cloud cluster - /// A datastore in a private cloud cluster /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4010,9 +5052,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DatastoresCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4026,8 +5068,6 @@ public partial class VMware + global::System.Uri.EscapeDataString(privateCloudName) + "/clusters/" + global::System.Uri.EscapeDataString(clusterName) - + "/datastores/" - + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4036,23 +5076,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DatastoresCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ClustersDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Create or update a datastore in a private cloud cluster + /// Delete a cluster in a private cloud /// - /// A datastore in a private cloud cluster /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4060,18 +5096,18 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DatastoresCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } // replace URI parameters with values from identity @@ -4079,7 +5115,6 @@ public partial class VMware var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; var clusterName = _match.Groups["clusterName"].Value; - var datastoreName = _match.Groups["datastoreName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4090,8 +5125,6 @@ public partial class VMware + privateCloudName + "/clusters/" + clusterName - + "/datastores/" - + datastoreName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4100,22 +5133,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DatastoresCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ClustersDelete_Call (request, onOk,onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4123,7 +5153,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DatastoresCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4132,22 +5162,19 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -4161,10 +5188,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -4173,45 +5196,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4219,10 +5242,10 @@ public partial class VMware continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + if (!string.IsNullOrWhiteSpace(_finalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -4233,6 +5256,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4240,13 +5264,19 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Datastore.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4262,20 +5292,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Name of the datastore in the private cloud cluster - /// A datastore in a private cloud cluster /// 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 DatastoresCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClustersDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4285,21 +5313,18 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(datastoreName),datastoreName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); } } - /// Delete a datastore in a private cloud cluster + /// Get a cluster by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Name of the datastore in the private cloud cluster /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4307,9 +5332,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DatastoresDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4323,8 +5348,6 @@ public partial class VMware + global::System.Uri.EscapeDataString(privateCloudName) + "/clusters/" + global::System.Uri.EscapeDataString(clusterName) - + "/datastores/" - + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4333,19 +5356,18 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DatastoresDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ClustersGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a datastore in a private cloud cluster + /// Get a cluster by name in a private cloud /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -4353,18 +5375,18 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DatastoresDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } // replace URI parameters with values from identity @@ -4372,7 +5394,6 @@ public partial class VMware var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; var clusterName = _match.Groups["clusterName"].Value; - var datastoreName = _match.Groups["datastoreName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4383,8 +5404,6 @@ public partial class VMware + privateCloudName + "/clusters/" + clusterName - + "/datastores/" - + datastoreName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4393,216 +5412,83 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DatastoresDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ClustersGet_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Get a cluster by name in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + // verify that Identity format is an exact match for uri - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); + } - // drop the old response - _response?.Dispose(); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the datastore in the private cloud cluster - /// 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 DatastoresDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(datastoreName),datastoreName); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersGetWithResult_Call (request, eventListener,sender); } } - /// Get a datastore in a private cloud cluster + /// Get a cluster by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Name of the datastore in the private cloud cluster - /// 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.VMware.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 DatastoresGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4616,85 +5502,84 @@ public partial class VMware + global::System.Uri.EscapeDataString(privateCloudName) + "/clusters/" + global::System.Uri.EscapeDataString(clusterName) - + "/datastores/" - + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.DatastoresGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClustersGetWithResult_Call (request, eventListener,sender); } } - /// Get a datastore in a private cloud cluster - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var datastoreName = _match.Groups["datastoreName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/clusters/" - + clusterName - + "/datastores/" - + datastoreName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.DatastoresGet_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 @@ -4704,7 +5589,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task DatastoresGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4715,6 +5600,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4722,13 +5608,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Datastore.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4744,19 +5630,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Name of the datastore in the private cloud cluster /// 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 DatastoresGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClustersGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4766,16 +5651,16 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(datastoreName),datastoreName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); } } - /// List datastores in a private cloud cluster + /// List clusters in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud /// 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). @@ -4784,9 +5669,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DatastoresList(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -4798,9 +5683,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/datastores" + + "/clusters" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4814,11 +5697,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DatastoresList_Call(request,onOk,onDefault,eventListener,sender); + await this.ClustersList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List datastores in a private cloud cluster + /// List clusters in a private cloud /// /// 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 @@ -4828,25 +5711,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task DatastoresListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -4855,9 +5737,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName - + "/datastores" + + "/clusters" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -4871,210 +5751,113 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.DatastoresList_Call(request,onOk,onDefault,eventListener,sender); + await this.ClustersList_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). + /// List clusters in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.DatastoreList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters'"); } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// 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 DatastoresList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - } - } - /// Create or update a global reach connection in a private cloud - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the global reach connection in the private cloud - /// A global reach connection in the private cloud - /// 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.VMware.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 GlobalReachConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) + + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/globalReachConnections/" - + global::System.Uri.EscapeDataString(globalReachConnectionName) + + privateCloudName + + "/clusters" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GlobalReachConnectionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClustersListWithResult_Call (request, eventListener,sender); } } - /// Create or update a global reach connection in a private cloud - /// - /// A global reach connection in the private cloud - /// 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). + /// List clusters in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var globalReachConnectionName = _match.Groups["globalReachConnectionName"].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.AVS/privateClouds/" - + privateCloudName - + "/globalReachConnections/" - + globalReachConnectionName + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GlobalReachConnectionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClustersListWithResult_Call (request, 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 - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5082,123 +5865,37 @@ public partial class VMware try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -5212,42 +5909,12 @@ public partial class VMware } } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the global reach connection in the private cloud - /// A global reach connection in the private cloud - /// 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 GlobalReachConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(globalReachConnectionName),globalReachConnectionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Delete a global reach connection in a private cloud + /// List hosts by zone in a cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the global reach connection in the private cloud + /// Name of the cluster in the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -5255,9 +5922,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GlobalReachConnectionsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListZones(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5269,8 +5936,9 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/globalReachConnections/" - + global::System.Uri.EscapeDataString(globalReachConnectionName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/listZones" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5279,19 +5947,18 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GlobalReachConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ClustersListZones_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a global reach connection in a private cloud + /// List hosts by zone in a cluster /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -5299,25 +5966,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GlobalReachConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListZonesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -5326,8 +5993,9 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/globalReachConnections/" - + globalReachConnectionName + + "/clusters/" + + clusterName + + "/listZones" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5336,213 +6004,84 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.GlobalReachConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ClustersListZones_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// List hosts by zone in a cluster + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListZonesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + // verify that Identity format is an exact match for uri - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); + } - // drop the old response - _response?.Dispose(); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/listZones" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + // 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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the global reach connection in the private cloud - /// 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 GlobalReachConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(globalReachConnectionName),globalReachConnectionName); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersListZonesWithResult_Call (request, eventListener,sender); } } - /// Get a global reach connection by name in a private cloud + /// List hosts by zone in a cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the global reach connection in the private cloud - /// 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). + /// Name of the cluster in the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersListZonesWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5554,82 +6093,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/globalReachConnections/" - + global::System.Uri.EscapeDataString(globalReachConnectionName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/listZones" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.GlobalReachConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClustersListZonesWithResult_Call (request, eventListener,sender); } } - /// Get a global reach connection by name in a private cloud - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersListZonesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZoneList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/globalReachConnections/" - + globalReachConnectionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GlobalReachConnectionsGet_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 @@ -5639,7 +6183,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GlobalReachConnectionsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersListZones_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5650,6 +6194,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5657,13 +6202,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterZoneList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5679,18 +6224,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the global reach connection in the private cloud + /// Name of the cluster in the private cloud /// 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 GlobalReachConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClustersListZones_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5700,14 +6245,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(globalReachConnectionName),globalReachConnectionName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); } } - /// List global reach connections in a private cloud - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// 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). @@ -5716,103 +6261,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task GlobalReachConnectionsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-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.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/globalReachConnections" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GlobalReachConnectionsList_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// List global reach connections in a private cloud - /// - /// 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.VMware.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 GlobalReachConnectionsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/globalReachConnections$", 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.AVS/privateClouds/{privateCloudName}/globalReachConnections'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/globalReachConnections" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.GlobalReachConnectionsList_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -5823,6 +6272,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5830,13 +6280,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnectionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5852,8 +6302,8 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -5862,7 +6312,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task GlobalReachConnectionsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClustersList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5872,27 +6322,28 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Create or update an HCX Enterprise Site in a private cloud + /// Update a cluster in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the HCX Enterprise Site in the private cloud - /// The HCX Enterprise Site + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// The cluster properties to be updated /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite 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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -5904,8 +6355,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/hcxEnterpriseSites/" - + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5914,50 +6365,50 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.HcxEnterpriseSitesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update an HCX Enterprise Site in a private cloud + /// Update a cluster in a private cloud /// - /// The HCX Enterprise Site + /// The cluster properties to be updated /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite 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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -5966,8 +6417,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/hcxEnterpriseSites/" - + hcxEnterpriseSiteName + + "/clusters/" + + clusterName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -5976,121 +6427,95 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.HcxEnterpriseSitesCreateOrUpdate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.ClustersUpdate_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 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Update a cluster in a private cloud + /// + /// The cluster properties to be updated /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the HCX Enterprise Site in the private cloud - /// The HCX Enterprise Site - /// 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 HcxEnterpriseSitesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IHcxEnterpriseSite body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(hcxEnterpriseSiteName),hcxEnterpriseSiteName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete an HCX Enterprise Site in a private cloud + /// Update a cluster in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the HCX Enterprise Site in the private cloud - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Name of the cluster in the private cloud + /// The cluster properties to be updated /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClustersUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6102,86 +6527,183 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/hcxEnterpriseSites/" - + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.HcxEnterpriseSitesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.ClustersUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete an HCX Enterprise Site in a private cloud - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); - } + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/hcxEnterpriseSites/" - + hcxEnterpriseSiteName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // 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.VMware.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.HcxEnterpriseSitesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -6189,7 +6711,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClustersUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6198,8 +6720,100 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6207,19 +6821,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6235,18 +6843,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the cluster in the private cloud + /// The cluster properties to be updated /// 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 HcxEnterpriseSitesDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClustersUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6256,26 +6865,33 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(hcxEnterpriseSiteName),hcxEnterpriseSiteName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get an HCX Enterprise Site by name in a private cloud + /// Create a datastore in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the HCX Enterprise Site in the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster + /// A datastore in a private cloud cluster /// 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.VMware.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 HcxEnterpriseSitesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6287,8 +6903,10 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/hcxEnterpriseSites/" - + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores/" + + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6297,44 +6915,51 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.HcxEnterpriseSitesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get an HCX Enterprise Site by name in a private cloud + /// Create a datastore in a private cloud cluster /// + /// A datastore in a private cloud cluster /// 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.VMware.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 HcxEnterpriseSitesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var datastoreName = _match.Groups["datastoreName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -6343,8 +6968,10 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/hcxEnterpriseSites/" - + hcxEnterpriseSiteName + + "/clusters/" + + clusterName + + "/datastores/" + + datastoreName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6353,105 +6980,99 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.HcxEnterpriseSitesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresCreateOrUpdate_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). + /// Create a datastore in a private cloud cluster + /// + /// A datastore in a private cloud cluster /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the HCX Enterprise Site in the private cloud - /// 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 HcxEnterpriseSitesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(hcxEnterpriseSiteName),hcxEnterpriseSiteName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var datastoreName = _match.Groups["datastoreName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/datastores/" + + datastoreName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DatastoresCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// List HCX Enterprise Sites in a private cloud + /// Create a datastore in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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). + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster + /// A datastore in a private cloud cluster /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6463,79 +7084,183 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/hcxEnterpriseSites" + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores/" + + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.HcxEnterpriseSitesList_Call(request,onOk,onDefault,eventListener,sender); + return await this.DatastoresCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// List HCX Enterprise Sites in a private cloud - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DatastoresCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites'"); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/hcxEnterpriseSites" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // 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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.HcxEnterpriseSitesList_Call(request,onOk,onDefault,eventListener,sender); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -6545,7 +7270,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DatastoresCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6554,8 +7279,100 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6563,13 +7380,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.HcxEnterpriseSiteList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6585,17 +7402,20 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster + /// A datastore in a private cloud cluster /// 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 HcxEnterpriseSitesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DatastoresCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -6605,13 +7425,24 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(datastoreName),datastoreName); + await eventListener.AssertRegEx(nameof(datastoreName), datastoreName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Return quota for subscription by region + /// Delete a datastore in a private cloud cluster /// The ID of the target subscription. - /// Azure region + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -6619,9 +7450,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailability(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6629,9 +7460,14 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.AVS/locations/" - + global::System.Uri.EscapeDataString(location) - + "/checkQuotaAvailability" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores/" + + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6640,18 +7476,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsCheckQuotaAvailability_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Return quota for subscription by region + /// Delete a datastore in a private cloud cluster /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -6659,30 +7496,38 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailabilityViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/locations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var datastoreName = _match.Groups["datastoreName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.AVS/locations/" - + location - + "/checkQuotaAvailability" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/datastores/" + + datastoreName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6691,18 +7536,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsCheckQuotaAvailability_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresDelete_Call (request, onOk,onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -6710,7 +7556,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailability_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DatastoresDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6719,8 +7565,101 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6728,13 +7667,19 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Quota.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6750,28 +7695,42 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. - /// Azure region + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster /// 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 LocationsCheckQuotaAvailability_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DatastoresDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(datastoreName),datastoreName); + await eventListener.AssertRegEx(nameof(datastoreName), datastoreName, @"^[-\w\._]+$"); } } - /// Return trial status for subscription by region + /// Get a datastore in a private cloud cluster /// The ID of the target subscription. - /// Azure region + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster /// 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). @@ -6780,9 +7739,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsCheckTrialAvailability(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -6790,9 +7749,14 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.AVS/locations/" - + global::System.Uri.EscapeDataString(location) - + "/checkTrialAvailability" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores/" + + global::System.Uri.EscapeDataString(datastoreName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6801,16 +7765,16 @@ public partial class VMware // 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.VMware.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsCheckTrialAvailability_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Return trial status for subscription by region + /// Get a datastore in a private cloud cluster /// /// 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 @@ -6820,30 +7784,38 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsCheckTrialAvailabilityViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/locations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var location = _match.Groups["location"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var datastoreName = _match.Groups["datastoreName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.AVS/locations/" - + location - + "/checkTrialAvailability" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/datastores/" + + datastoreName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6852,26 +7824,128 @@ public partial class VMware // 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.VMware.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsCheckTrialAvailability_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a datastore in a private cloud cluster + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var datastoreName = _match.Groups["datastoreName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/datastores/" + + datastoreName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DatastoresGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a datastore in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores/" + + global::System.Uri.EscapeDataString(datastoreName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DatastoresGetWithResult_Call (request, 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 - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 LocationsCheckTrialAvailability_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DatastoresGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -6879,24 +7953,37 @@ public partial class VMware try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Trial.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -6910,27 +7997,92 @@ public partial class VMware } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// Azure region + /// 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.VMware.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 LocationsCheckTrialAvailability_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DatastoresGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(location),location); + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Lists all of the available operations + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the datastore in the private cloud cluster + /// 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 DatastoresGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string datastoreName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(datastoreName),datastoreName); + await eventListener.AssertRegEx(nameof(datastoreName), datastoreName, @"^[-\w\._]+$"); + } + } + + /// List datastores in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud /// 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). @@ -6939,15 +8091,23 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresList(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.AVS/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6961,11 +8121,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Lists all of the available operations + /// List datastores in a private cloud cluster /// /// 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 @@ -6975,24 +8135,36 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task DatastoresListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.AVS/operations'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores'"); } // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.AVS/operations" + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/datastores" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7006,11 +8178,171 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.DatastoresList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List datastores in a private cloud cluster + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/datastores$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/datastores" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DatastoresListWithResult_Call (request, eventListener,sender); + } + } + + /// List datastores in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 DatastoresListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/datastores" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.DatastoresListWithResult_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.VMware.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 DatastoresListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -7020,7 +8352,7 @@ public partial class VMware /// /// 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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task DatastoresList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7031,6 +8363,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7038,13 +8371,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.DatastoreList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7060,39 +8393,51 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud /// 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 OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task DatastoresList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); } } - /// Create or update a placement policy in a private cloud cluster + /// Create a global reach connection in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - /// A placement policy in the private cloud cluster + /// The name of the private cloud. + /// Name of the global reach connection in the private cloud + /// A global reach connection in the private cloud /// 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.VMware.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 PlacementPoliciesCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7104,10 +8449,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/placementPolicies/" - + global::System.Uri.EscapeDataString(placementPolicyName) + + "/globalReachConnections/" + + global::System.Uri.EscapeDataString(globalReachConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7121,45 +8464,45 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.GlobalReachConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a placement policy in a private cloud cluster + /// Create a global reach connection in a private cloud /// - /// A placement policy in the private cloud cluster + /// A global reach connection in the private cloud /// 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.VMware.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 PlacementPoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var placementPolicyName = _match.Groups["placementPolicyName"].Value; + var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -7168,10 +8511,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName - + "/placementPolicies/" - + placementPolicyName + + "/globalReachConnections/" + + globalReachConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7185,15 +8526,280 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.GlobalReachConnectionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a global reach connection in a private cloud + /// + /// A global reach connection in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/globalReachConnections/" + + globalReachConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GlobalReachConnectionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create a global reach connection in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the global reach connection in the private cloud + /// A global reach connection in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/globalReachConnections/" + + global::System.Uri.EscapeDataString(globalReachConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GlobalReachConnectionsCreateOrUpdateWithResult_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.VMware.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 GlobalReachConnectionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -7203,7 +8809,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PlacementPoliciesCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7212,6 +8818,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -7221,13 +8828,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -7241,10 +8843,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -7253,45 +8851,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -7313,6 +8911,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7320,13 +8919,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7342,20 +8941,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - /// A placement policy in the private cloud cluster + /// The name of the private cloud. + /// Name of the global reach connection in the private cloud + /// A global reach connection in the private cloud /// 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 PlacementPoliciesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7365,19 +8963,18 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + await eventListener.AssertNotNull(nameof(globalReachConnectionName),globalReachConnectionName); + await eventListener.AssertRegEx(nameof(globalReachConnectionName), globalReachConnectionName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a placement policy in a private cloud cluster + /// Delete a global reach connection in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// Name of the global reach connection in the private cloud /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -7387,9 +8984,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PlacementPoliciesDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7401,10 +8998,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/placementPolicies/" - + global::System.Uri.EscapeDataString(placementPolicyName) + + "/globalReachConnections/" + + global::System.Uri.EscapeDataString(globalReachConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7418,11 +9013,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.GlobalReachConnectionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Delete a placement policy in a private cloud cluster + /// Delete a global reach connection in a private cloud /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -7433,26 +9028,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PlacementPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var placementPolicyName = _match.Groups["placementPolicyName"].Value; + var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -7461,10 +9055,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName - + "/placementPolicies/" - + placementPolicyName + + "/globalReachConnections/" + + globalReachConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7478,11 +9070,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.GlobalReachConnectionsDelete_Call (request, onOk,onNoContent,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 204 (NoContent). @@ -7493,7 +9085,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PlacementPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7502,6 +9094,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -7512,13 +9105,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -7532,10 +9120,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -7544,45 +9128,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -7604,6 +9188,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7623,7 +9208,7 @@ public partial class VMware default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7639,19 +9224,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// Name of the global reach connection in the private cloud /// 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 PlacementPoliciesDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7661,17 +9245,17 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(globalReachConnectionName),globalReachConnectionName); + await eventListener.AssertRegEx(nameof(globalReachConnectionName), globalReachConnectionName, @"^[-\w\._]+$"); } } - /// Get a placement policy by name in a private cloud cluster + /// Get a global reach connection by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// Name of the global reach connection in the private cloud /// 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). @@ -7680,9 +9264,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PlacementPoliciesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7694,10 +9278,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/placementPolicies/" - + global::System.Uri.EscapeDataString(placementPolicyName) + + "/globalReachConnections/" + + global::System.Uri.EscapeDataString(globalReachConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7711,11 +9293,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.GlobalReachConnectionsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a placement policy by name in a private cloud cluster + /// Get a global reach connection by name in a private cloud /// /// 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 @@ -7725,26 +9307,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PlacementPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var placementPolicyName = _match.Groups["placementPolicyName"].Value; + var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -7753,10 +9334,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName - + "/placementPolicies/" - + placementPolicyName + + "/globalReachConnections/" + + globalReachConnectionName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -7770,103 +9349,78 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.GlobalReachConnectionsGet_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). + /// Get a global reach connection by name in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PlacementPoliciesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/globalReachConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - /// 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 PlacementPoliciesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var globalReachConnectionName = _match.Groups["globalReachConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/globalReachConnections/" + + globalReachConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GlobalReachConnectionsGetWithResult_Call (request, eventListener,sender); } } - /// List placement policies in a private cloud cluster + /// Get a global reach connection by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// 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). + /// Name of the global reach connection in the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PlacementPoliciesList(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -7878,84 +9432,88 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/placementPolicies" + + "/globalReachConnections/" + + global::System.Uri.EscapeDataString(globalReachConnectionName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PlacementPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + return await this.GlobalReachConnectionsGetWithResult_Call (request, eventListener,sender); } } - /// List placement policies in a private cloud cluster - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PlacementPoliciesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/clusters/" - + clusterName - + "/placementPolicies" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PlacementPoliciesList_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 @@ -7965,7 +9523,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PlacementPoliciesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -7976,6 +9534,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7983,13 +9542,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPoliciesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8005,18 +9564,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud + /// Name of the global reach connection in the private cloud /// 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 PlacementPoliciesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string globalReachConnectionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8026,17 +9585,16 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(globalReachConnectionName),globalReachConnectionName); + await eventListener.AssertRegEx(nameof(globalReachConnectionName), globalReachConnectionName, @"^[-\w\._]+$"); } } - /// Update a placement policy in a private cloud cluster + /// List global reach connections in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - /// The placement policy properties that may be updated /// 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). @@ -8045,9 +9603,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PlacementPoliciesUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8059,10 +9617,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/placementPolicies/" - + global::System.Uri.EscapeDataString(placementPolicyName) + + "/globalReachConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8071,22 +9626,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.GlobalReachConnectionsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update a placement policy in a private cloud cluster + /// List global reach connections in a private cloud /// - /// The placement policy properties that may be updated /// 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). @@ -8095,26 +9645,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PlacementPoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/globalReachConnections$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var placementPolicyName = _match.Groups["placementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8123,10 +9671,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/clusters/" - + clusterName - + "/placementPolicies/" - + placementPolicyName + + "/globalReachConnections" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8135,139 +9680,193 @@ public partial class VMware // 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.VMware.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PlacementPoliciesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.GlobalReachConnectionsList_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). + /// List global reach connections in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PlacementPoliciesUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task GlobalReachConnectionsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/globalReachConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/globalReachConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GlobalReachConnectionsListWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// List global reach connections in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/globalReachConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.GlobalReachConnectionsListWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 GlobalReachConnectionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 GlobalReachConnectionsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8275,13 +9874,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnectionList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8297,20 +9896,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get + /// Validation method for method. Call this like the actual call, but you will get /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy - /// The placement policy properties that may be updated /// 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 PlacementPoliciesUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task GlobalReachConnectionsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8320,29 +9916,29 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Create or update a private cloud + /// Create an activation key for on-premises HCX site /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// The private cloud + /// The name of the private cloud. + /// Name of the HCX Enterprise Site in the private cloud + /// The HCX Enterprise Site /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite 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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8354,6 +9950,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) + + "/hcxEnterpriseSites/" + + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8367,43 +9965,46 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesCreateOrUpdate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Create or update a private cloud + /// Create an activation key for on-premises HCX site /// - /// The private cloud + /// The HCX Enterprise Site /// 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. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite 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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8412,6 +10013,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName + + "/hcxEnterpriseSites/" + + hcxEnterpriseSiteName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8425,134 +10028,215 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesCreateOrUpdate_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 default (any response code not handled - /// elsewhere). + /// Create an activation key for on-premises HCX site + /// + /// The HCX Enterprise Site /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // verify that Identity format is an exact match for uri - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/hcxEnterpriseSites/" + + hcxEnterpriseSiteName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.HcxEnterpriseSitesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + /// Create an activation key for on-premises HCX site + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the HCX Enterprise Site in the private cloud + /// The HCX Enterprise Site + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/hcxEnterpriseSites/" + + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + // 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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.HcxEnterpriseSitesCreateOrUpdateWithResult_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.VMware.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 HcxEnterpriseSitesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 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. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 HcxEnterpriseSitesCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8560,13 +10244,19 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8582,18 +10272,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// The private cloud + /// The name of the private cloud. + /// Name of the HCX Enterprise Site in the private cloud + /// The HCX Enterprise Site /// 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 PrivateCloudsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IHcxEnterpriseSite body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8603,15 +10294,18 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertNotNull(nameof(hcxEnterpriseSiteName),hcxEnterpriseSiteName); + await eventListener.AssertRegEx(nameof(hcxEnterpriseSiteName), hcxEnterpriseSiteName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a private cloud + /// Delete HCX on-premises key in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the HCX Enterprise Site in the private cloud /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled @@ -8621,9 +10315,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8635,6 +10329,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) + + "/hcxEnterpriseSites/" + + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8648,11 +10344,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Delete a private cloud + /// Delete HCX on-premises key in a private cloud /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). @@ -8663,24 +10359,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8689,6 +10386,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName + + "/hcxEnterpriseSites/" + + hcxEnterpriseSiteName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8702,11 +10401,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesDelete_Call (request, onOk,onNoContent,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 204 (NoContent). @@ -8717,7 +10416,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateCloudsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8728,106 +10427,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8847,7 +10447,7 @@ public partial class VMware default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8863,17 +10463,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the HCX Enterprise Site in the private cloud /// 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 PrivateCloudsDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8883,13 +10484,17 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(hcxEnterpriseSiteName),hcxEnterpriseSiteName); + await eventListener.AssertRegEx(nameof(hcxEnterpriseSiteName), hcxEnterpriseSiteName, @"^[-\w\._]+$"); } } - /// Get a private cloud + /// Get an HCX on-premises key by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the HCX Enterprise Site in the private cloud /// 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). @@ -8898,9 +10503,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsGet(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -8912,6 +10517,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) + + "/hcxEnterpriseSites/" + + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8925,11 +10532,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a private cloud + /// Get an HCX on-premises key by name in a private cloud /// /// 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 @@ -8939,24 +10546,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -8965,6 +10573,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName + + "/hcxEnterpriseSites/" + + hcxEnterpriseSiteName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8978,139 +10588,78 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesGet_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). + /// Get an HCX on-premises key by name in a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites/{hcxEnterpriseSiteName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 PrivateCloudsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - } - } - - /// List private clouds in a resource group - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// 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.VMware.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 PrivateCloudsList(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var hcxEnterpriseSiteName = _match.Groups["hcxEnterpriseSiteName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.AVS/privateClouds" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/hcxEnterpriseSites/" + + hcxEnterpriseSiteName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateCloudsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.HcxEnterpriseSitesGetWithResult_Call (request, eventListener,sender); } } - /// List the admin credentials for the private cloud + /// Get an HCX on-premises key by name in a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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). + /// Name of the HCX Enterprise Site in the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListAdminCredentials(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9122,79 +10671,86 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/listAdminCredentials" + + "/hcxEnterpriseSites/" + + global::System.Uri.EscapeDataString(hcxEnterpriseSiteName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateCloudsListAdminCredentials_Call(request,onOk,onDefault,eventListener,sender); + return await this.HcxEnterpriseSitesGetWithResult_Call (request, eventListener,sender); } } - /// List the admin credentials for the private cloud - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListAdminCredentialsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/listAdminCredentials" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateCloudsListAdminCredentials_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 @@ -9204,7 +10760,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateCloudsListAdminCredentials_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9215,6 +10771,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9222,13 +10779,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.AdminCredentials.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSite.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9244,17 +10801,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the HCX Enterprise Site in the private cloud /// 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 PrivateCloudsListAdminCredentials_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string hcxEnterpriseSiteName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9264,11 +10822,16 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(hcxEnterpriseSiteName),hcxEnterpriseSiteName); + await eventListener.AssertRegEx(nameof(hcxEnterpriseSiteName), hcxEnterpriseSiteName, @"^[-\w\._]+$"); } } - /// List private clouds in a subscription + /// List HCX on-premises key in a private cloud /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud /// 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). @@ -9277,9 +10840,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsListInSubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9287,7 +10850,11 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.AVS/privateClouds" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/hcxEnterpriseSites" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9301,11 +10868,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsListInSubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.HcxEnterpriseSitesList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List private clouds in a subscription + /// List HCX on-premises key in a private cloud /// /// 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 @@ -9315,27 +10882,33 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsListInSubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.AVS/privateClouds" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/hcxEnterpriseSites" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9349,215 +10922,76 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsListInSubscription_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). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListInSubscription_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); 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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. - /// 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 PrivateCloudsListInSubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await this.HcxEnterpriseSitesList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List private clouds in a resource group + /// List HCX on-premises key in a private cloud /// - /// 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.VMware.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 PrivateCloudsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/hcxEnterpriseSites$", 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.AVS/privateClouds'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/hcxEnterpriseSites'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds" + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/hcxEnterpriseSites" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateCloudsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.HcxEnterpriseSitesListWithResult_Call (request, 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). + /// List HCX on-premises key in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task HcxEnterpriseSitesListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); 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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// 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 PrivateCloudsList_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - } - } - - /// Rotate the NSX-T Manager password - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// a delegate that is called when the remote service returns 204 (NoContent). - /// 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.VMware.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 PrivateCloudsRotateNsxtPassword(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-01"; - // Constant Parameters + var apiVersion = @"2023-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { // construct URL @@ -9568,81 +11002,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/rotateNsxtPassword" + + "/hcxEnterpriseSites" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.PrivateCloudsRotateNsxtPassword_Call(request,onNoContent,onDefault,eventListener,sender); + return await this.HcxEnterpriseSitesListWithResult_Call (request, eventListener,sender); } } - /// Rotate the NSX-T Manager password - /// - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsRotateNsxtPasswordViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/rotateNsxtPassword" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.PrivateCloudsRotateNsxtPassword_Call(request,onNoContent,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 204 (NoContent). + /// 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. @@ -9650,7 +11090,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateCloudsRotateNsxtPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9661,120 +11101,21 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.NoContent: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.HcxEnterpriseSiteList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9790,8 +11131,8 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -9800,7 +11141,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task PrivateCloudsRotateNsxtPassword_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task HcxEnterpriseSitesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9810,14 +11151,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Rotate the vCenter password + /// Return quota for subscription by region /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// a delegate that is called when the remote service returns 204 (NoContent). + /// Azure region + /// 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. @@ -9825,9 +11166,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsRotateVcenterPassword(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailability(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -9835,11 +11176,9 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/rotateVcenterPassword" + + "/providers/Microsoft.AVS/locations/" + + global::System.Uri.EscapeDataString(location) + + "/checkQuotaAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9853,13 +11192,13 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsRotateVcenterPassword_Call(request,onNoContent,onDefault,eventListener,sender); + await this.LocationsCheckQuotaAvailability_Call (request, onOk,onDefault,eventListener,sender); } } - /// Rotate the vCenter password + /// Return quota for subscription by region /// - /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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. @@ -9867,33 +11206,30 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task PrivateCloudsRotateVcenterPasswordViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailabilityViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.AVS/locations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; + var location = _match.Groups["location"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/rotateVcenterPassword" + + "/providers/Microsoft.AVS/locations/" + + location + + "/checkQuotaAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9907,145 +11243,196 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsRotateVcenterPassword_Call(request,onNoContent,onDefault,eventListener,sender); + await this.LocationsCheckQuotaAvailability_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Return quota for subscription by region + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsRotateVcenterPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailabilityViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + // verify that Identity format is an exact match for uri - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.AVS/locations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}'"); + } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.AVS/locations/" + + location + + "/checkQuotaAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + // 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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsCheckQuotaAvailabilityWithResult_Call (request, eventListener,sender); + } + } - // drop the old response - _response?.Dispose(); + /// Return quota for subscription by region + /// The ID of the target subscription. + /// Azure region + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 LocationsCheckQuotaAvailabilityWithResult(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.AVS/locations/" + + global::System.Uri.EscapeDataString(location) + + "/checkQuotaAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + // 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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsCheckQuotaAvailabilityWithResult_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.VMware.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 LocationsCheckQuotaAvailabilityWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Quota.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 LocationsCheckQuotaAvailability_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.NoContent: + case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Quota.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10061,45 +11448,41 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud + /// Azure region /// 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 PrivateCloudsRotateVcenterPassword_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LocationsCheckQuotaAvailability_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertNotNull(nameof(location),location); } } - /// Update a private cloud + /// Return trial status for subscription by region /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// The private cloud properties to be updated + /// Azure region + /// The sku to check for trial availability /// 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.VMware.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 PrivateCloudsUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckTrialAvailability(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10107,10 +11490,9 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) + + "/providers/Microsoft.AVS/locations/" + + global::System.Uri.EscapeDataString(location) + + "/checkTrialAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10119,56 +11501,55 @@ public partial class VMware // 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.VMware.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.LocationsCheckTrialAvailability_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update a private cloud + /// Return trial status for subscription by region /// - /// The private cloud properties to be updated + /// The sku to check for trial availability /// 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.VMware.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 PrivateCloudsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckTrialAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.AVS/locations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; + var location = _match.Groups["location"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName + + "/providers/Microsoft.AVS/locations/" + + location + + "/checkTrialAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10177,213 +11558,88 @@ public partial class VMware // 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.VMware.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.PrivateCloudsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.LocationsCheckTrialAvailability_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). + /// Return trial status for subscription by region + /// + /// The sku to check for trial availability /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckTrialAvailabilityViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // verify that Identity format is an exact match for uri - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.AVS/locations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}'"); + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.AVS/locations/" + + location + + "/checkTrialAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsCheckTrialAvailabilityWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// The private cloud properties to be updated - /// 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 PrivateCloudsUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// - /// Return information about a script cmdlet resource in a specific package on a private cloud - /// + /// Return trial status for subscription by region /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the script package in the private cloud - /// Name of the script cmdlet resource in the script package in the private cloud - /// 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). + /// Azure region + /// The sku to check for trial availability /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsCheckTrialAvailabilityWithResult(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -10391,93 +11647,93 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptPackages/" - + global::System.Uri.EscapeDataString(scriptPackageName) - + "/scriptCmdlets/" - + global::System.Uri.EscapeDataString(scriptCmdletName) + + "/providers/Microsoft.AVS/locations/" + + global::System.Uri.EscapeDataString(location) + + "/checkTrialAvailability" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScriptCmdletsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.LocationsCheckTrialAvailabilityWithResult_Call (request, eventListener,sender); } } /// - /// Return information about a script cmdlet resource in a specific package on a private cloud + /// Actual wire call for method. /// - /// - /// 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 prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LocationsCheckTrialAvailabilityWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)/scriptCmdlets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Trial.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptPackageName = _match.Groups["scriptPackageName"].Value; - var scriptCmdletName = _match.Groups["scriptCmdletName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/scriptPackages/" - + scriptPackageName - + "/scriptCmdlets/" - + scriptCmdletName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ScriptCmdletsGet_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 @@ -10487,7 +11743,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScriptCmdletsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LocationsCheckTrialAvailability_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10498,6 +11754,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10505,13 +11762,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdlet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Trial.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10527,40 +11784,29 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the script package in the private cloud - /// Name of the script cmdlet resource in the script package in the private cloud + /// Azure region + /// The sku to check for trial availability /// 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 ScriptCmdletsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task LocationsCheckTrialAvailability_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptPackageName),scriptPackageName); - await eventListener.AssertNotNull(nameof(scriptCmdletName),scriptCmdletName); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the script package in the private cloud + /// Lists all of the available operations /// 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). @@ -10569,23 +11815,15 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptCmdletsList(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptPackages/" - + global::System.Uri.EscapeDataString(scriptPackageName) - + "/scriptCmdlets" + "/providers/Microsoft.AVS/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10599,13 +11837,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptCmdletsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud - /// + /// Lists all of the available operations /// /// 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 @@ -10615,36 +11851,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptCmdletsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)/scriptCmdlets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.AVS/operations$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.AVS/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptPackageName = _match.Groups["scriptPackageName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/scriptPackages/" - + scriptPackageName - + "/scriptCmdlets" + "/providers/Microsoft.AVS/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10658,198 +11882,147 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptCmdletsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_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). + /// Lists all of the available operations + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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("^/providers/Microsoft.AVS/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 '/providers/Microsoft.AVS/operations'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptCmdletsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.AVS/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the script package in the private cloud - /// 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 ScriptCmdletsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptPackageName),scriptPackageName); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// Create or update a script execution in a private cloud - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the user-invoked script execution resource - /// A script running in the private cloud - /// 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). + /// Lists all of the available operations /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListWithResult(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptExecutions/" - + global::System.Uri.EscapeDataString(scriptExecutionName) + "/providers/Microsoft.AVS/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScriptExecutionsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.OperationsListWithResult_Call (request, eventListener,sender); } } - /// Create or update a script execution in a private cloud - /// - /// A script running in the private cloud - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/scriptExecutions/" - + scriptExecutionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ScriptExecutionsCreateOrUpdate_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 @@ -10859,7 +12032,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScriptExecutionsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10870,105 +12043,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10976,13 +12051,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.OperationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10998,51 +12073,40 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the private cloud. - /// Name of the user-invoked script execution resource - /// A script running in the private cloud /// 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 ScriptExecutionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + } } - /// Cancel a ScriptExecution in a private cloud + /// Create a placement policy in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the user-invoked script execution resource + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// A placement policy in the private cloud cluster /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// 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.VMware.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 ScriptExecutionsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11054,8 +12118,10 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptExecutions/" - + global::System.Uri.EscapeDataString(scriptExecutionName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11064,45 +12130,51 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptExecutionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PlacementPoliciesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Cancel a ScriptExecution in a private cloud + /// Create a placement policy in a private cloud cluster /// + /// A placement policy in the private cloud cluster /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// 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.VMware.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 ScriptExecutionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -11111,8 +12183,10 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/scriptExecutions/" - + scriptExecutionName + + "/clusters/" + + clusterName + + "/placementPolicies/" + + placementPolicyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11121,19 +12195,291 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PlacementPoliciesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a placement policy in a private cloud cluster + /// + /// A placement policy in the private cloud cluster + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PlacementPoliciesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/placementPolicies/" + + placementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PlacementPoliciesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create a placement policy in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// A placement policy in the private cloud cluster + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PlacementPoliciesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScriptExecutionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.PlacementPoliciesCreateOrUpdateWithResult_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.VMware.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 PlacementPoliciesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -11141,7 +12487,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScriptExecutionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11150,23 +12496,18 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -11180,10 +12521,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -11192,45 +12529,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -11238,10 +12575,10 @@ public partial class VMware continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + if (!string.IsNullOrWhiteSpace(_originalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -11252,6 +12589,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -11259,19 +12597,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -11287,18 +12619,20 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the user-invoked script execution resource + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// A placement policy in the private cloud cluster /// 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 ScriptExecutionsDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PlacementPoliciesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11308,16 +12642,24 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + await eventListener.AssertRegEx(nameof(placementPolicyName), placementPolicyName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get an script execution by name in a private cloud + /// Delete a placement policy in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the user-invoked script execution resource + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -11325,9 +12667,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptExecutionsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11339,8 +12681,10 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptExecutions/" - + global::System.Uri.EscapeDataString(scriptExecutionName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11349,23 +12693,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptExecutionsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Return the logs for a script execution resource - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the user-invoked script execution resource - /// Name of the desired output stream to return. If not provided, will return all. An empty array will - /// return nothing + /// Delete a placement policy in a private cloud cluster + /// /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -11373,75 +12713,26 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptExecutionsGetExecutionLogs(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptExecutions/" - + global::System.Uri.EscapeDataString(scriptExecutionName) - + "/getExecutionLogs" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(body, (__x) => null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null))) : null, 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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ScriptExecutionsGetExecutionLogs_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Return the logs for a script execution resource - /// - /// Name of the desired output stream to return. If not provided, will return all. An empty array will - /// return nothing - /// 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.VMware.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 ScriptExecutionsGetExecutionLogsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -11450,9 +12741,10 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/scriptExecutions/" - + scriptExecutionName - + "/getExecutionLogs" + + "/clusters/" + + clusterName + + "/placementPolicies/" + + placementPolicyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11461,22 +12753,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(body, (__x) => null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null))) : null, 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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptExecutionsGetExecutionLogs_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesDelete_Call (request, onOk,onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -11484,7 +12773,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScriptExecutionsGetExecutionLogs_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11493,146 +12782,101 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the user-invoked script execution resource - /// Name of the desired output stream to return. If not provided, will return all. An empty array will - /// return nothing - /// 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 ScriptExecutionsGetExecutionLogs_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); - if (body != null ) { - for (int __i = 0; __i < body.Length; __i++) { - await eventListener.AssertEnum($"body[{__i}]",body[__i],@"Information", @"Warning", @"Output", @"Error"); - } - } - } - } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - /// Get an script execution by name in a private cloud - /// - /// 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.VMware.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 ScriptExecutionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri + // drop the old response + _response?.Dispose(); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); - } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/scriptExecutions/" - + scriptExecutionName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } - // 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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ScriptExecutionsGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + // drop the old response + _response?.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.VMware.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 ScriptExecutionsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -11640,13 +12884,19 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -11662,18 +12912,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the user-invoked script execution resource + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy /// 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 ScriptExecutionsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PlacementPoliciesDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -11683,14 +12934,20 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + await eventListener.AssertRegEx(nameof(placementPolicyName), placementPolicyName, @"^[-\w\._]+$"); } } - /// List script executions in a private cloud + /// Get a placement policy by name in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy /// 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). @@ -11699,9 +12956,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptExecutionsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11713,7 +12970,10 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptExecutions" + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11727,11 +12987,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptExecutionsList_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// List script executions in a private cloud + /// Get a placement policy by name in a private cloud cluster /// /// 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 @@ -11741,24 +13001,26 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptExecutionsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -11767,7 +13029,10 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/scriptExecutions" + + "/clusters/" + + clusterName + + "/placementPolicies/" + + placementPolicyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11781,99 +13046,82 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptExecutionsList_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesGet_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). - /// an instance that will receive events. + /// Get a placement policy by name in a private cloud cluster + /// + /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecutionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 ScriptExecutionsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/placementPolicies/" + + placementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PlacementPoliciesGetWithResult_Call (request, eventListener,sender); } } - /// Get a script package available to run on a private cloud + /// Get a placement policy by name in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the script package in the private cloud - /// 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). + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -11885,82 +13133,88 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptPackages/" - + global::System.Uri.EscapeDataString(scriptPackageName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ScriptPackagesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.PlacementPoliciesGetWithResult_Call (request, eventListener,sender); } } - /// Get a script package available to run on a private cloud - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var scriptPackageName = _match.Groups["scriptPackageName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/scriptPackages/" - + scriptPackageName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ScriptPackagesGet_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 @@ -11970,7 +13224,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ScriptPackagesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -11981,6 +13235,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -11988,13 +13243,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -12010,18 +13265,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Name of the script package in the private cloud + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy /// 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 ScriptPackagesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PlacementPoliciesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -12031,14 +13287,19 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(scriptPackageName),scriptPackageName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + await eventListener.AssertRegEx(nameof(placementPolicyName), placementPolicyName, @"^[-\w\._]+$"); } } - /// List script packages available to run on the private cloud + /// List placement policies in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// Name of the cluster in the private cloud /// 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). @@ -12047,9 +13308,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptPackagesList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesList(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12061,7 +13322,9 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/scriptPackages" + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/placementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12075,11 +13338,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptPackagesList_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesList_Call (request, onOk,onDefault,eventListener,sender); } } - /// List script packages available to run on the private cloud + /// List placement policies in a private cloud cluster /// /// 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 @@ -12089,24 +13352,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ScriptPackagesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -12115,7 +13379,9 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/scriptPackages" + + "/clusters/" + + clusterName + + "/placementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12129,100 +13395,79 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ScriptPackagesList_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesList_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). + /// List placement policies in a private cloud cluster + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptPackagesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 ScriptPackagesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/placementPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PlacementPoliciesListWithResult_Call (request, eventListener,sender); } } - /// Get a virtual machine by id in a private cloud cluster + /// List placement policies in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Virtual Machine identifier - /// 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.VMware.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 VirtualMachinesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12236,85 +13481,85 @@ public partial class VMware + global::System.Uri.EscapeDataString(privateCloudName) + "/clusters/" + global::System.Uri.EscapeDataString(clusterName) - + "/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineId) + + "/placementPolicies" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VirtualMachinesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.PlacementPoliciesListWithResult_Call (request, eventListener,sender); } } - /// Get a virtual machine by id in a private cloud cluster - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPoliciesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var virtualMachineId = _match.Groups["virtualMachineId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/clusters/" - + clusterName - + "/virtualMachines/" - + virtualMachineId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.VirtualMachinesGet_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 @@ -12324,7 +13569,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12335,6 +13580,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -12342,13 +13588,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPoliciesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -12364,19 +13610,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get validation + /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Virtual Machine identifier /// 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 VirtualMachinesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PlacementPoliciesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -12386,27 +13631,31 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(virtualMachineId),virtualMachineId); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); } } - /// List of virtual machines in a private cloud cluster + /// Update a placement policy in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// The placement policy properties that may be updated /// 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.VMware.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 VirtualMachinesList(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12420,7 +13669,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(privateCloudName) + "/clusters/" + global::System.Uri.EscapeDataString(clusterName) - + "/virtualMachines" + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12429,37 +13679,43 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesList_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// List of virtual machines in a private cloud cluster + /// Update a placement policy in a private cloud cluster /// + /// The placement policy properties that may be updated /// 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.VMware.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 VirtualMachinesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); } // replace URI parameters with values from identity @@ -12467,6 +13723,7 @@ public partial class VMware var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -12477,7 +13734,8 @@ public partial class VMware + privateCloudName + "/clusters/" + clusterName - + "/virtualMachines" + + "/placementPolicies/" + + placementPolicyName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12486,107 +13744,99 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesList_Call(request,onOk,onDefault,eventListener,sender); + await this.PlacementPoliciesUpdate_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). + /// Update a placement policy in a private cloud cluster + /// + /// The placement policy properties that may be updated /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachinesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/placementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// 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 VirtualMachinesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var placementPolicyName = _match.Groups["placementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/placementPolicies/" + + placementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PlacementPoliciesUpdateWithResult_Call (request, eventListener,sender); } } - /// Enable or disable DRS-driven VM movement restriction + /// Update a placement policy in a private cloud cluster /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// Name of the cluster in the private cloud - /// Virtual Machine identifier - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// The placement policy properties that may be updated /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesRestrictMovement(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PlacementPoliciesUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -12600,104 +13850,38 @@ public partial class VMware + global::System.Uri.EscapeDataString(privateCloudName) + "/clusters/" + global::System.Uri.EscapeDataString(clusterName) - + "/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineId) - + "/restrictMovement" + + "/placementPolicies/" + + global::System.Uri.EscapeDataString(placementPolicyName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.VirtualMachinesRestrictMovement_Call(request,onDefault,eventListener,sender); - } - } - - /// Enable or disable DRS-driven VM movement restriction - /// - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) - /// 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.VMware.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 VirtualMachinesRestrictMovementViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var virtualMachineId = _match.Groups["virtualMachineId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/clusters/" - + clusterName - + "/virtualMachines/" - + virtualMachineId - + "/restrictMovement" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VirtualMachinesRestrictMovement_Call(request,onDefault,eventListener,sender); + return await this.PlacementPoliciesUpdateWithResult_Call (request, 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 default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesRestrictMovement_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12705,24 +13889,19 @@ public partial class VMware try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -12736,57 +13915,53 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -12794,29 +13969,48 @@ public partial class VMware continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + if (!string.IsNullOrWhiteSpace(_originalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); // drop the old response _response?.Dispose(); // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -12830,150 +14024,7 @@ public partial class VMware } } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Name of the cluster in the private cloud - /// Virtual Machine identifier - /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) - /// 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 VirtualMachinesRestrictMovement_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertNotNull(nameof(virtualMachineId),virtualMachineId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Create dhcp by id in a private cloud workload network. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// NSX DHCP - /// 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.VMware.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 WorkloadNetworksCreateDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-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.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dhcpConfigurations/" - + global::System.Uri.EscapeDataString(dhcpId) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksCreateDhcp_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Create dhcp by id in a private cloud workload network. - /// - /// NSX DHCP - /// 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.VMware.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 WorkloadNetworksCreateDhcpViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) - { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var dhcpId = _match.Groups["dhcpId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/dhcpConfigurations/" - + dhcpId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksCreateDhcp_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 @@ -12983,7 +14034,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksCreateDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PlacementPoliciesUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -12992,6 +14043,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -13001,13 +14053,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -13021,10 +14068,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -13033,45 +14076,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -13093,6 +14136,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13100,13 +14144,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13122,19 +14166,20 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get + /// Validation method for method. Call this like the actual call, but you will get /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// NSX DHCP + /// Name of the cluster in the private cloud + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// The placement policy properties that may be updated /// 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 WorkloadNetworksCreateDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PlacementPoliciesUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string placementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13144,29 +14189,33 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(placementPolicyName),placementPolicyName); + await eventListener.AssertRegEx(nameof(placementPolicyName), placementPolicyName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create a DNS service by id in a private cloud workload network. + /// Create a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name - /// NSX DNS Service + /// The private cloud /// 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.VMware.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 WorkloadNetworksCreateDnsService(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13178,8 +14227,6 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsServices/" - + global::System.Uri.EscapeDataString(dnsServiceId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13193,44 +14240,44 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateDnsService_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a DNS service by id in a private cloud workload network. + /// Create a private cloud /// - /// NSX DNS Service + /// The private cloud /// 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.VMware.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 WorkloadNetworksCreateDnsServiceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var dnsServiceId = _match.Groups["dnsServiceId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13239,8 +14286,6 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsServices/" - + dnsServiceId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13254,15 +14299,272 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateDnsService_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a private cloud + /// + /// The private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// The private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsCreateOrUpdateWithResult_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.VMware.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 PrivateCloudsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -13272,7 +14574,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksCreateDnsService_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13281,6 +14583,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -13290,13 +14593,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -13310,10 +14608,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -13322,45 +14616,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -13382,6 +14676,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13389,13 +14684,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13411,19 +14706,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name - /// NSX DNS Service + /// The private cloud /// 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 WorkloadNetworksCreateDnsService_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13433,19 +14727,18 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create a DNS zone by id in a private cloud workload network. + /// Delete a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// NSX DNS Zone /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -13453,9 +14746,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreateDnsZone(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13467,8 +14760,6 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsZones/" - + global::System.Uri.EscapeDataString(dnsZoneId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13477,23 +14768,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateDnsZone_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Create a DNS zone by id in a private cloud workload network. + /// Delete a private cloud /// - /// NSX DNS Zone /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -13501,25 +14788,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreateDnsZoneViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var dnsZoneId = _match.Groups["dnsZoneId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13528,8 +14814,6 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsZones/" - + dnsZoneId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13538,22 +14822,19 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateDnsZone_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsDelete_Call (request, onOk,onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -13561,7 +14842,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksCreateDnsZone_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13570,22 +14851,19 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -13599,10 +14877,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -13611,45 +14885,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -13657,10 +14931,10 @@ public partial class VMware continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + if (!string.IsNullOrWhiteSpace(_finalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -13671,6 +14945,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13678,13 +14953,19 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13700,19 +14981,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// NSX DNS Zone /// 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 WorkloadNetworksCreateDnsZone_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13722,18 +15001,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Create a port mirroring profile by id in a private cloud workload network. + /// Get a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name - /// NSX port mirroring /// 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). @@ -13742,9 +15017,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreatePortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsGet(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -13756,8 +15031,6 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/portMirroringProfiles/" - + global::System.Uri.EscapeDataString(portMirroringId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13766,22 +15039,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreatePortMirroring_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a port mirroring profile by id in a private cloud workload network. + /// Get a private cloud /// - /// NSX port mirroring /// 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). @@ -13790,25 +15058,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreatePortMirroringViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var portMirroringId = _match.Groups["portMirroringId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -13817,8 +15084,6 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/portMirroringProfiles/" - + portMirroringId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13827,139 +15092,189 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreatePortMirroring_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsGet_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). + /// Get a private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreatePortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsGetWithResult_Call (request, eventListener,sender); + } + } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 PrivateCloudsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13967,13 +15282,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13989,19 +15304,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name - /// NSX port mirroring /// 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 WorkloadNetworksCreatePortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14011,18 +15324,55 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Create a Public IP Block by id in a private cloud workload network. + /// List private clouds in a resource group + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// 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.VMware.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 PrivateCloudsList(string subscriptionId, string resourceGroupName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateCloudsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List the admin credentials for the private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name - /// NSX Public IP Block /// 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). @@ -14031,9 +15381,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreatePublicIP(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListAdminCredentials(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14045,8 +15395,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/publicIPs/" - + global::System.Uri.EscapeDataString(publicIPId) + + "/listAdminCredentials" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14055,22 +15404,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreatePublicIP_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsListAdminCredentials_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a Public IP Block by id in a private cloud workload network. + /// List the admin credentials for the private cloud /// - /// NSX Public IP Block /// 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). @@ -14079,25 +15423,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreatePublicIPViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListAdminCredentialsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var publicIPId = _match.Groups["publicIPId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14106,8 +15449,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/publicIPs/" - + publicIPId + + "/listAdminCredentials" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14116,139 +15458,193 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreatePublicIP_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsListAdminCredentials_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). + /// List the admin credentials for the private cloud + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreatePublicIP_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListAdminCredentialsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/listAdminCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // 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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsListAdminCredentialsWithResult_Call (request, eventListener,sender); + } + } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + /// List the admin credentials for the private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListAdminCredentialsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/listAdminCredentials" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // 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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsListAdminCredentialsWithResult_Call (request, eventListener,sender); + } + } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListAdminCredentialsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AdminCredentials.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 PrivateCloudsListAdminCredentials_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -14256,13 +15652,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIP.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AdminCredentials.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -14278,19 +15674,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name - /// NSX Public IP Block /// 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 WorkloadNetworksCreatePublicIP_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsListAdminCredentials_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14300,18 +15694,12 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(publicIPId),publicIPId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Create a segment by id in a private cloud workload network. + /// List private clouds in a subscription /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX Segment identifier. Generally the same as the Segment's display name - /// NSX Segment /// 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). @@ -14320,9 +15708,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreateSegments(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListInSubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14330,12 +15718,7 @@ public partial class VMware var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/segments/" - + global::System.Uri.EscapeDataString(segmentId) + + "/providers/Microsoft.AVS/privateClouds" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14344,22 +15727,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateSegments_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsListInSubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a segment by id in a private cloud workload network. + /// List private clouds in a subscription /// - /// NSX Segment /// 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). @@ -14368,35 +15746,27 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreateSegmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListInSubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.AVS/privateClouds$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var segmentId = _match.Groups["segmentId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/segments/" - + segmentId + + "/providers/Microsoft.AVS/privateClouds" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14405,139 +15775,181 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateSegments_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsListInSubscription_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). + /// List private clouds in a subscription + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateSegments_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListInSubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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/(?[^/]+)/providers/Microsoft.AVS/privateClouds$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.AVS/privateClouds" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsListInSubscriptionWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// List private clouds in a subscription + /// The ID of the target subscription. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListInSubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.AVS/privateClouds" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsListInSubscriptionWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListInSubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 PrivateCloudsListInSubscription_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -14545,13 +15957,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -14567,40 +15979,25 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX Segment identifier. Generally the same as the Segment's display name - /// NSX Segment /// 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 WorkloadNetworksCreateSegments_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsListInSubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(segmentId),segmentId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create a vm group by id in a private cloud workload network. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// NSX VM Group + /// List private clouds in a resource group + /// /// 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). @@ -14609,22 +16006,30 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksCreateVMGroup(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds$", 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.AVS/privateClouds'"); + } + + // 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/" - + global::System.Uri.EscapeDataString(subscriptionId) + + subscriptionId + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.AVS/privateClouds/" - + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/vmGroups/" - + global::System.Uri.EscapeDataString(vmGroupId) + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14633,81 +16038,164 @@ public partial class VMware // 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.VMware.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksCreateVMGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.PrivateCloudsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a vm group by id in a private cloud workload network. + /// List private clouds in a resource group /// - /// NSX VM Group - /// 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.VMware.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 WorkloadNetworksCreateVMGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var vmGroupId = _match.Groups["vmGroupId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/vmGroups/" - + vmGroupId + + "/providers/Microsoft.AVS/privateClouds" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsListWithResult_Call (request, eventListener,sender); + } + } + + /// List private clouds in a resource group + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 PrivateCloudsListWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksCreateVMGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.PrivateCloudsListWithResult_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.VMware.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 PrivateCloudsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -14717,7 +16205,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksCreateVMGroup_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14728,105 +16216,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -14834,13 +16224,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -14856,19 +16246,16 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// NSX VM Group /// 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 WorkloadNetworksCreateVMGroup_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsList_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14877,19 +16264,13 @@ public partial class VMware await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete dhcp by id in a private cloud workload network. + /// Rotate the NSX-T Manager password /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -14898,9 +16279,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsRotateNsxtPassword(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -14912,8 +16293,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dhcpConfigurations/" - + global::System.Uri.EscapeDataString(dhcpId) + + "/rotateNsxtPassword" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14922,18 +16302,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteDhcp_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateCloudsRotateNsxtPassword_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Delete dhcp by id in a private cloud workload network. + /// Rotate the NSX-T Manager password /// - /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -14942,25 +16321,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteDhcpViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsRotateNsxtPasswordViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var dhcpId = _match.Groups["dhcpId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -14969,8 +16347,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dhcpConfigurations/" - + dhcpId + + "/rotateNsxtPassword" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14979,18 +16356,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteDhcp_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateCloudsRotateNsxtPassword_Call (request, onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -14999,7 +16375,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksDeleteDhcp_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsRotateNsxtPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15008,6 +16384,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -15018,13 +16395,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -15038,10 +16410,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -15050,45 +16418,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -15110,16 +16478,11 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } case global::System.Net.HttpStatusCode.NoContent: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -15129,7 +16492,7 @@ public partial class VMware default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -15145,18 +16508,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DHCP identifier. Generally the same as the DHCP display name /// 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 WorkloadNetworksDeleteDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsRotateNsxtPassword_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15166,16 +16528,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Delete a DNS service by id in a private cloud workload network. + /// Rotate the vCenter password /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name /// Name of the private cloud - /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15184,9 +16544,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteDnsService(string subscriptionId, string resourceGroupName, string dnsServiceId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsRotateVcenterPassword(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15198,8 +16558,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsServices/" - + global::System.Uri.EscapeDataString(dnsServiceId) + + "/rotateVcenterPassword" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15208,18 +16567,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteDnsService_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateCloudsRotateVcenterPassword_Call (request, onNoContent,onDefault,eventListener,sender); } } - /// Delete a DNS service by id in a private cloud workload network. + /// Rotate the vCenter password /// - /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15228,24 +16586,23 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteDnsServiceViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsRotateVcenterPasswordViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var dnsServiceId = _match.Groups["dnsServiceId"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -15255,8 +16612,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsServices/" - + dnsServiceId + + "/rotateVcenterPassword" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15265,18 +16621,17 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteDnsService_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateCloudsRotateVcenterPassword_Call (request, onNoContent,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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15285,7 +16640,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksDeleteDnsService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsRotateVcenterPassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15294,6 +16649,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -15304,13 +16660,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -15324,10 +16675,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -15336,45 +16683,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -15396,16 +16743,11 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } case global::System.Net.HttpStatusCode.NoContent: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } @@ -15415,7 +16757,7 @@ public partial class VMware default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -15431,18 +16773,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you + /// Validation method for method. Call this like the actual call, but you /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name /// Name of the private cloud /// 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 WorkloadNetworksDeleteDnsService_Validate(string subscriptionId, string resourceGroupName, string dnsServiceId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsRotateVcenterPassword_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15451,28 +16792,28 @@ public partial class VMware await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Delete a DNS zone by id in a private cloud workload network. + /// Update a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name /// Name of the private cloud + /// The private cloud properties to be updated /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// 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.VMware.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 WorkloadNetworksDeleteDnsZone(string subscriptionId, string resourceGroupName, string dnsZoneId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15484,8 +16825,6 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsZones/" - + global::System.Uri.EscapeDataString(dnsZoneId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15494,44 +16833,48 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteDnsZone_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateCloudsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a DNS zone by id in a private cloud workload network. + /// Update a private cloud /// + /// The private cloud properties to be updated /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// 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.VMware.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 WorkloadNetworksDeleteDnsZoneViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var dnsZoneId = _match.Groups["dnsZoneId"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -15541,8 +16884,6 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsZones/" - + dnsZoneId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15551,214 +16892,91 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteDnsZone_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.PrivateCloudsUpdate_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Update a private cloud + /// + /// The private cloud properties to be updated /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksDeleteDnsZone_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // verify that Identity format is an exact match for uri - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}'"); + } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // drop the old response - _response?.Dispose(); + // 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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.PrivateCloudsUpdateWithResult_Call (request, eventListener,sender); + } + } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// Name of the private cloud - /// 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 WorkloadNetworksDeleteDnsZone_Validate(string subscriptionId, string resourceGroupName, string dnsZoneId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - } - } - - /// Delete a port mirroring profile by id in a private cloud workload network. + /// Update a private cloud /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name /// Name of the private cloud - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The private cloud properties to be updated /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksDeletePortMirroring(string subscriptionId, string resourceGroupName, string portMirroringId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task PrivateCloudsUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -15770,86 +16988,181 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/portMirroringProfiles/" - + global::System.Uri.EscapeDataString(portMirroringId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksDeletePortMirroring_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.PrivateCloudsUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete a port mirroring profile by id in a private cloud workload network. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksDeletePortMirroringViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var portMirroringId = _match.Groups["portMirroringId"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/portMirroringProfiles/" - + portMirroringId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // 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.VMware.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksDeletePortMirroring_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -15857,7 +17170,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksDeletePortMirroring_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task PrivateCloudsUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15866,23 +17179,18 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -15896,10 +17204,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -15908,45 +17212,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -15954,10 +17258,10 @@ public partial class VMware continue; } // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + if (!string.IsNullOrWhiteSpace(_originalUri)) { // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -15968,6 +17272,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -15975,19 +17280,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16003,18 +17302,18 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name /// Name of the private cloud + /// The private cloud properties to be updated /// 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 WorkloadNetworksDeletePortMirroring_Validate(string subscriptionId, string resourceGroupName, string portMirroringId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task PrivateCloudsUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16023,18 +17322,22 @@ public partial class VMware await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete a Public IP Block by id in a private cloud workload network. + /// + /// Return information about a script cmdlet resource in a specific package on a private cloud + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name /// Name of the private cloud + /// Name of the script package in the private cloud + /// Name of the script cmdlet resource in the script package in the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16042,9 +17345,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeletePublicIP(string subscriptionId, string resourceGroupName, string publicIPId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScriptCmdletsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16056,8 +17359,10 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/publicIPs/" - + global::System.Uri.EscapeDataString(publicIPId) + + "/scriptPackages/" + + global::System.Uri.EscapeDataString(scriptPackageName) + + "/scriptCmdlets/" + + global::System.Uri.EscapeDataString(scriptCmdletName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16066,19 +17371,20 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeletePublicIP_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ScriptCmdletsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a Public IP Block by id in a private cloud workload network. + /// + /// Return information about a script cmdlet resource in a specific package on a private cloud + /// /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16086,25 +17392,26 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeletePublicIPViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScriptCmdletsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)/scriptCmdlets/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var publicIPId = _match.Groups["publicIPId"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptPackageName = _match.Groups["scriptPackageName"].Value; + var scriptCmdletName = _match.Groups["scriptCmdletName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -16113,8 +17420,10 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/publicIPs/" - + publicIPId + + "/scriptPackages/" + + scriptPackageName + + "/scriptCmdlets/" + + scriptCmdletName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16123,137 +17432,205 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeletePublicIP_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ScriptCmdletsGet_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Return information about a script cmdlet resource in a specific package on a private cloud + /// + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksDeletePublicIP_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScriptCmdletsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)/scriptCmdlets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptPackageName = _match.Groups["scriptPackageName"].Value; + var scriptCmdletName = _match.Groups["scriptCmdletName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptPackages/" + + scriptPackageName + + "/scriptCmdlets/" + + scriptCmdletName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptCmdletsGetWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// + /// Return information about a script cmdlet resource in a specific package on a private cloud + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the script package in the private cloud + /// Name of the script cmdlet resource in the script package in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptPackages/" + + global::System.Uri.EscapeDataString(scriptPackageName) + + "/scriptCmdlets/" + + global::System.Uri.EscapeDataString(scriptCmdletName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptCmdletsGetWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdlet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptCmdletsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -16261,19 +17638,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdlet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16289,18 +17660,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name /// Name of the private cloud + /// Name of the script package in the private cloud + /// Name of the script cmdlet resource in the script package in the private cloud /// 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 WorkloadNetworksDeletePublicIP_Validate(string subscriptionId, string resourceGroupName, string publicIPId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ScriptCmdletsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, string scriptCmdletName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16309,18 +17681,23 @@ public partial class VMware await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(publicIPId),publicIPId); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(scriptPackageName),scriptPackageName); + await eventListener.AssertRegEx(nameof(scriptPackageName), scriptPackageName, @"^[-\w\._@]+$"); + await eventListener.AssertNotNull(nameof(scriptCmdletName),scriptCmdletName); + await eventListener.AssertRegEx(nameof(scriptCmdletName), scriptCmdletName, @"^[-\w\._]+$"); } } - /// Delete a segment by id in a private cloud workload network. + /// + /// List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud + /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Segment identifier. Generally the same as the Segment's display name + /// Name of the script package in the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16328,9 +17705,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteSegment(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScriptCmdletsList(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16342,8 +17719,9 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/segments/" - + global::System.Uri.EscapeDataString(segmentId) + + "/scriptPackages/" + + global::System.Uri.EscapeDataString(scriptPackageName) + + "/scriptCmdlets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16352,19 +17730,20 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteSegment_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ScriptCmdletsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a segment by id in a private cloud workload network. + /// + /// List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud + /// /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16372,25 +17751,25 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteSegmentViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ScriptCmdletsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)/scriptCmdlets$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var segmentId = _match.Groups["segmentId"].Value; + var scriptPackageName = _match.Groups["scriptPackageName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -16399,8 +17778,9 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/segments/" - + segmentId + + "/scriptPackages/" + + scriptPackageName + + "/scriptCmdlets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16409,19 +17789,12703 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteSegment_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.ScriptCmdletsList_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 204 (NoContent). + /// + /// List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)/scriptCmdlets$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptPackageName = _match.Groups["scriptPackageName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptPackages/" + + scriptPackageName + + "/scriptCmdlets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptCmdletsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the script package in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptCmdletsListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptPackages/" + + global::System.Uri.EscapeDataString(scriptPackageName) + + "/scriptCmdlets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptCmdletsListWithResult_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.VMware.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 ScriptCmdletsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptCmdletsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptCmdletsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the script package in the private cloud + /// 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 ScriptCmdletsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(scriptPackageName),scriptPackageName); + await eventListener.AssertRegEx(nameof(scriptPackageName), scriptPackageName, @"^[-\w\._@]+$"); + } + } + + /// Create a script execution in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the user-invoked script execution resource + /// A script running in the private cloud + /// 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.VMware.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 ScriptExecutionsCreateOrUpdate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a script execution in a private cloud + /// + /// A script running in the private cloud + /// 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.VMware.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 ScriptExecutionsCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a script execution in a private cloud + /// + /// A script running in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Create a script execution in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the user-invoked script execution resource + /// A script running in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsCreateOrUpdateWithResult_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.VMware.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 ScriptExecutionsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptExecutionsCreateOrUpdate_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the private cloud. + /// Name of the user-invoked script execution resource + /// A script running in the private cloud + /// 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 ScriptExecutionsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); + await eventListener.AssertRegEx(nameof(scriptExecutionName), scriptExecutionName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Cancel a ScriptExecution in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 ScriptExecutionsDelete(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Cancel a ScriptExecution in a private cloud + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 ScriptExecutionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsDelete_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 ScriptExecutionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// 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 ScriptExecutionsDelete_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); + await eventListener.AssertRegEx(nameof(scriptExecutionName), scriptExecutionName, @"^[-\w\._]+$"); + } + } + + /// Get an script execution by name in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// 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.VMware.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 ScriptExecutionsGet(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Return the logs for a script execution resource + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// Name of the desired output stream to return. If not provided, will return all. An empty array will + /// return nothing + /// 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.VMware.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 ScriptExecutionsGetExecutionLogs(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, System.Collections.Generic.List body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "/getExecutionLogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToList(System.Linq.Enumerable.Select(body, (__x) => null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null))) : null, 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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsGetExecutionLogs_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Return the logs for a script execution resource + /// + /// Name of the desired output stream to return. If not provided, will return all. An empty array will + /// return nothing + /// 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.VMware.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 ScriptExecutionsGetExecutionLogsViaIdentity(global::System.String viaIdentity, System.Collections.Generic.List body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "/getExecutionLogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToList(System.Linq.Enumerable.Select(body, (__x) => null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null))) : null, 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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsGetExecutionLogs_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Return the logs for a script execution resource + /// + /// Name of the desired output stream to return. If not provided, will return all. An empty array will + /// return nothing + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsGetExecutionLogsViaIdentityWithResult(global::System.String viaIdentity, System.Collections.Generic.List body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "/getExecutionLogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToList(System.Linq.Enumerable.Select(body, (__x) => null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null))) : null, 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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsGetExecutionLogsWithResult_Call (request, eventListener,sender); + } + } + + /// Return the logs for a script execution resource + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// Name of the desired output stream to return. If not provided, will return all. An empty array will + /// return nothing + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsGetExecutionLogsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, System.Collections.Generic.List body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "/getExecutionLogs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.XNodeArray(global::System.Linq.Enumerable.ToList(System.Linq.Enumerable.Select(body, (__x) => null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonString(__x.ToString()) : null))) : null, 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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsGetExecutionLogsWithResult_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.VMware.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 ScriptExecutionsGetExecutionLogsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptExecutionsGetExecutionLogs_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// Name of the desired output stream to return. If not provided, will return all. An empty array will + /// return nothing + /// 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 ScriptExecutionsGetExecutionLogs_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, System.Collections.Generic.List body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); + await eventListener.AssertRegEx(nameof(scriptExecutionName), scriptExecutionName, @"^[-\w\._]+$"); + } + } + + /// Get an script execution by name in a private cloud + /// + /// 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.VMware.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 ScriptExecutionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get an script execution by name in a private cloud + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptExecutionName = _match.Groups["scriptExecutionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions/" + + scriptExecutionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get an script execution by name in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions/" + + global::System.Uri.EscapeDataString(scriptExecutionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsGetWithResult_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.VMware.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 ScriptExecutionsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptExecutionsGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the user-invoked script execution resource + /// 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 ScriptExecutionsGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptExecutionName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(scriptExecutionName),scriptExecutionName); + await eventListener.AssertRegEx(nameof(scriptExecutionName), scriptExecutionName, @"^[-\w\._]+$"); + } + } + + /// List script executions in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// 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.VMware.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 ScriptExecutionsList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List script executions in a private cloud + /// + /// 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.VMware.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 ScriptExecutionsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptExecutionsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List script executions in a private cloud + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptExecutions$", 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.AVS/privateClouds/{privateCloudName}/scriptExecutions'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptExecutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsListWithResult_Call (request, eventListener,sender); + } + } + + /// List script executions in a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptExecutionsListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptExecutions" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptExecutionsListWithResult_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.VMware.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 ScriptExecutionsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptExecutionsList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecutionsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// 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 ScriptExecutionsList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Get a script package available to run on a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the script package in the private cloud + /// 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.VMware.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 ScriptPackagesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptPackages/" + + global::System.Uri.EscapeDataString(scriptPackageName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptPackagesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a script package available to run on a private cloud + /// + /// 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.VMware.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 ScriptPackagesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptPackageName = _match.Groups["scriptPackageName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptPackages/" + + scriptPackageName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptPackagesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a script package available to run on a private cloud + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var scriptPackageName = _match.Groups["scriptPackageName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptPackages/" + + scriptPackageName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptPackagesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a script package available to run on a private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the script package in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptPackages/" + + global::System.Uri.EscapeDataString(scriptPackageName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptPackagesGetWithResult_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.VMware.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 ScriptPackagesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptPackagesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackage.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the script package in the private cloud + /// 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 ScriptPackagesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string scriptPackageName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(scriptPackageName),scriptPackageName); + await eventListener.AssertRegEx(nameof(scriptPackageName), scriptPackageName, @"^[-\w\._@]+$"); + } + } + + /// List script packages available to run on the private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// 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.VMware.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 ScriptPackagesList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptPackages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptPackagesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List script packages available to run on the private cloud + /// + /// 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.VMware.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 ScriptPackagesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptPackages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ScriptPackagesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List script packages available to run on the private cloud + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/scriptPackages$", 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.AVS/privateClouds/{privateCloudName}/scriptPackages'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/scriptPackages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptPackagesListWithResult_Call (request, eventListener,sender); + } + } + + /// List script packages available to run on the private cloud + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ScriptPackagesListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/scriptPackages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ScriptPackagesListWithResult_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.VMware.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 ScriptPackagesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackagesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 ScriptPackagesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptPackagesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// 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 ScriptPackagesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Get a virtual machine by id in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Virtual Machine identifier + /// 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.VMware.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 VirtualMachinesGet(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud cluster + /// + /// 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.VMware.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 VirtualMachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var virtualMachineId = _match.Groups["virtualMachineId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/virtualMachines/" + + virtualMachineId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud cluster + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var virtualMachineId = _match.Groups["virtualMachineId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/virtualMachines/" + + virtualMachineId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Virtual Machine identifier + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesGetWithResult_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.VMware.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 VirtualMachinesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 VirtualMachinesGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Virtual Machine identifier + /// 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 VirtualMachinesGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(virtualMachineId),virtualMachineId); + } + } + + /// List of virtual machines in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// 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.VMware.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 VirtualMachinesList(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List of virtual machines in a private cloud cluster + /// + /// 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.VMware.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 VirtualMachinesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List of virtual machines in a private cloud cluster + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesListWithResult_Call (request, eventListener,sender); + } + } + + /// List of virtual machines in a private cloud cluster + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 VirtualMachinesListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesListWithResult_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.VMware.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 VirtualMachinesListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachinesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 VirtualMachinesList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachinesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// 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 VirtualMachinesList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + } + } + + /// Enable or disable DRS-driven VM movement restriction + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Virtual Machine identifier + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// 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.VMware.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 VirtualMachinesRestrictMovement(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineId) + + "/restrictMovement" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesRestrictMovement_Call (request, onDefault,eventListener,sender); + } + } + + /// Enable or disable DRS-driven VM movement restriction + /// + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// 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.VMware.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 VirtualMachinesRestrictMovementViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement body, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/clusters/(?[^/]+)/virtualMachines/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var virtualMachineId = _match.Groups["virtualMachineId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/clusters/" + + clusterName + + "/virtualMachines/" + + virtualMachineId + + "/restrictMovement" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesRestrictMovement_Call (request, onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// 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.VMware.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 VirtualMachinesRestrictMovement_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Name of the cluster in the private cloud + /// Virtual Machine identifier + /// Whether VM DRS-driven movement is restricted (Enabled) or not (Disabled) + /// 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 VirtualMachinesRestrictMovement_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string clusterName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(virtualMachineId),virtualMachineId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create dhcp by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// NSX DHCP + /// 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.VMware.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 WorkloadNetworksCreateDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateDhcp_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create dhcp by id in a private cloud workload network. + /// + /// NSX DHCP + /// 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.VMware.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 WorkloadNetworksCreateDhcpViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateDhcp_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create dhcp by id in a private cloud workload network. + /// + /// NSX DHCP + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateDhcpViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateDhcpWithResult_Call (request, eventListener,sender); + } + } + + /// Create dhcp by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// NSX DHCP + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateDhcpWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateDhcpWithResult_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.VMware.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 WorkloadNetworksCreateDhcpWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreateDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// NSX DHCP + /// 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 WorkloadNetworksCreateDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a DNS service by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// NSX DNS Service + /// 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.VMware.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 WorkloadNetworksCreateDnsService(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateDnsService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a DNS service by id in a private cloud workload network. + /// + /// NSX DNS Service + /// 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.VMware.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 WorkloadNetworksCreateDnsServiceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateDnsService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a DNS service by id in a private cloud workload network. + /// + /// NSX DNS Service + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateDnsServiceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateDnsServiceWithResult_Call (request, eventListener,sender); + } + } + + /// Create a DNS service by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// NSX DNS Service + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateDnsServiceWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateDnsServiceWithResult_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.VMware.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 WorkloadNetworksCreateDnsServiceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreateDnsService_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// NSX DNS Service + /// 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 WorkloadNetworksCreateDnsService_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a DNS zone by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// NSX DNS Zone + /// 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.VMware.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 WorkloadNetworksCreateDnsZone(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateDnsZone_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a DNS zone by id in a private cloud workload network. + /// + /// NSX DNS Zone + /// 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.VMware.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 WorkloadNetworksCreateDnsZoneViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateDnsZone_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a DNS zone by id in a private cloud workload network. + /// + /// NSX DNS Zone + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateDnsZoneViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateDnsZoneWithResult_Call (request, eventListener,sender); + } + } + + /// Create a DNS zone by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// NSX DNS Zone + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateDnsZoneWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateDnsZoneWithResult_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.VMware.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 WorkloadNetworksCreateDnsZoneWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreateDnsZone_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// NSX DNS Zone + /// 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 WorkloadNetworksCreateDnsZone_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a port mirroring profile by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// NSX port mirroring + /// 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.VMware.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 WorkloadNetworksCreatePortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreatePortMirroring_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a port mirroring profile by id in a private cloud workload network. + /// + /// NSX port mirroring + /// 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.VMware.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 WorkloadNetworksCreatePortMirroringViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreatePortMirroring_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a port mirroring profile by id in a private cloud workload network. + /// + /// NSX port mirroring + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreatePortMirroringViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreatePortMirroringWithResult_Call (request, eventListener,sender); + } + } + + /// Create a port mirroring profile by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// NSX port mirroring + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreatePortMirroringWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreatePortMirroringWithResult_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.VMware.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 WorkloadNetworksCreatePortMirroringWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreatePortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// NSX port mirroring + /// 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 WorkloadNetworksCreatePortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a Public IP Block by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// NSX Public IP Block + /// 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.VMware.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 WorkloadNetworksCreatePublicIP(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/publicIPs/" + + global::System.Uri.EscapeDataString(publicIPId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreatePublicIP_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a Public IP Block by id in a private cloud workload network. + /// + /// NSX Public IP Block + /// 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.VMware.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 WorkloadNetworksCreatePublicIPViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var publicIPId = _match.Groups["publicIPId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/publicIPs/" + + publicIPId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreatePublicIP_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a Public IP Block by id in a private cloud workload network. + /// + /// NSX Public IP Block + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreatePublicIPViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var publicIPId = _match.Groups["publicIPId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/publicIPs/" + + publicIPId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreatePublicIPWithResult_Call (request, eventListener,sender); + } + } + + /// Create a Public IP Block by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// NSX Public IP Block + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreatePublicIPWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/publicIPs/" + + global::System.Uri.EscapeDataString(publicIPId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreatePublicIPWithResult_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.VMware.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 WorkloadNetworksCreatePublicIPWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreatePublicIP_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// NSX Public IP Block + /// 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 WorkloadNetworksCreatePublicIP_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(publicIPId),publicIPId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a segment by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// NSX Segment + /// 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.VMware.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 WorkloadNetworksCreateSegments(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/segments/" + + global::System.Uri.EscapeDataString(segmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateSegments_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a segment by id in a private cloud workload network. + /// + /// NSX Segment + /// 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.VMware.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 WorkloadNetworksCreateSegmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var segmentId = _match.Groups["segmentId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments/" + + segmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateSegments_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a segment by id in a private cloud workload network. + /// + /// NSX Segment + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateSegmentsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var segmentId = _match.Groups["segmentId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments/" + + segmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateSegmentsWithResult_Call (request, eventListener,sender); + } + } + + /// Create a segment by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// NSX Segment + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateSegmentsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/segments/" + + global::System.Uri.EscapeDataString(segmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateSegmentsWithResult_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.VMware.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 WorkloadNetworksCreateSegmentsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreateSegments_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// NSX Segment + /// 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 WorkloadNetworksCreateSegments_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(segmentId),segmentId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Create a vm group by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// NSX VM Group + /// 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.VMware.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 WorkloadNetworksCreateVMGroup(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/vmGroups/" + + global::System.Uri.EscapeDataString(vmGroupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateVMGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a vm group by id in a private cloud workload network. + /// + /// NSX VM Group + /// 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.VMware.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 WorkloadNetworksCreateVMGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var vmGroupId = _match.Groups["vmGroupId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups/" + + vmGroupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksCreateVMGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Create a vm group by id in a private cloud workload network. + /// + /// NSX VM Group + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateVMGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var vmGroupId = _match.Groups["vmGroupId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups/" + + vmGroupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateVMGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Create a vm group by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// NSX VM Group + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksCreateVMGroupWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/vmGroups/" + + global::System.Uri.EscapeDataString(vmGroupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksCreateVMGroupWithResult_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.VMware.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 WorkloadNetworksCreateVMGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksCreateVMGroup_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// NSX VM Group + /// 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 WorkloadNetworksCreateVMGroup_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete dhcp by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteDhcp_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete dhcp by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDhcpViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteDhcp_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDhcp_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// 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 WorkloadNetworksDeleteDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + } + } + + /// Delete a DNS service by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// Name of the private cloud + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDnsService(string subscriptionId, string resourceGroupName, string dnsServiceId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteDnsService_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a DNS service by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDnsServiceViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteDnsService_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDnsService_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// Name of the private cloud + /// 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 WorkloadNetworksDeleteDnsService_Validate(string subscriptionId, string resourceGroupName, string dnsServiceId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Delete a DNS zone by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// Name of the private cloud + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDnsZone(string subscriptionId, string resourceGroupName, string dnsZoneId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteDnsZone_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a DNS zone by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDnsZoneViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteDnsZone_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteDnsZone_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// Name of the private cloud + /// 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 WorkloadNetworksDeleteDnsZone_Validate(string subscriptionId, string resourceGroupName, string dnsZoneId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Delete a port mirroring profile by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// Name of the private cloud + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeletePortMirroring(string subscriptionId, string resourceGroupName, string portMirroringId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeletePortMirroring_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a port mirroring profile by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeletePortMirroringViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeletePortMirroring_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeletePortMirroring_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// Name of the private cloud + /// 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 WorkloadNetworksDeletePortMirroring_Validate(string subscriptionId, string resourceGroupName, string portMirroringId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Delete a Public IP Block by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// Name of the private cloud + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeletePublicIP(string subscriptionId, string resourceGroupName, string publicIPId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/publicIPs/" + + global::System.Uri.EscapeDataString(publicIPId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeletePublicIP_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a Public IP Block by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeletePublicIPViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var publicIPId = _match.Groups["publicIPId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/publicIPs/" + + publicIPId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeletePublicIP_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeletePublicIP_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// Name of the private cloud + /// 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 WorkloadNetworksDeletePublicIP_Validate(string subscriptionId, string resourceGroupName, string publicIPId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(publicIPId),publicIPId); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Delete a segment by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteSegment(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/segments/" + + global::System.Uri.EscapeDataString(segmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteSegment_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a segment by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteSegmentViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var segmentId = _match.Groups["segmentId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments/" + + segmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteSegment_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteSegment_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// 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 WorkloadNetworksDeleteSegment_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(segmentId),segmentId); + } + } + + /// Delete a vm group by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// Name of the private cloud + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteVMGroup(string subscriptionId, string resourceGroupName, string vmGroupId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/vmGroups/" + + global::System.Uri.EscapeDataString(vmGroupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteVMGroup_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete a vm group by id in a private cloud workload network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteVMGroupViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var vmGroupId = _match.Groups["vmGroupId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups/" + + vmGroupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksDeleteVMGroup_Call (request, onOk,onNoContent,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 204 (NoContent). + /// 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.VMware.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 WorkloadNetworksDeleteVMGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_finalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// Name of the private cloud + /// 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 WorkloadNetworksDeleteVMGroup_Validate(string subscriptionId, string resourceGroupName, string vmGroupId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Get a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// 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.VMware.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 WorkloadNetworksGet(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var workloadNetworkName = @"default"; + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/" + + global::System.Uri.EscapeDataString(workloadNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get dhcp by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// Name of the private cloud + /// 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.VMware.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 WorkloadNetworksGetDhcp(string subscriptionId, string resourceGroupName, string dhcpId, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetDhcp_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get dhcp by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetDhcpViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetDhcp_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get dhcp by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDhcpViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetDhcpWithResult_Call (request, eventListener,sender); + } + } + + /// Get dhcp by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDhcpWithResult(string subscriptionId, string resourceGroupName, string dhcpId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetDhcpWithResult_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.VMware.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 WorkloadNetworksGetDhcpWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// Name of the private cloud + /// 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 WorkloadNetworksGetDhcp_Validate(string subscriptionId, string resourceGroupName, string dhcpId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// Get a DNS service by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// 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.VMware.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 WorkloadNetworksGetDnsService(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetDnsService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a DNS service by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetDnsServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetDnsService_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a DNS service by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsServiceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetDnsServiceWithResult_Call (request, eventListener,sender); + } + } + + /// Get a DNS service by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsServiceWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetDnsServiceWithResult_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.VMware.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 WorkloadNetworksGetDnsServiceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetDnsService_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// 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 WorkloadNetworksGetDnsService_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); + } + } + + /// Get a DNS zone by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// 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.VMware.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 WorkloadNetworksGetDnsZone(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetDnsZone_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a DNS zone by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetDnsZoneViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetDnsZone_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a DNS zone by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsZoneViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetDnsZoneWithResult_Call (request, eventListener,sender); + } + } + + /// Get a DNS zone by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsZoneWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetDnsZoneWithResult_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.VMware.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 WorkloadNetworksGetDnsZoneWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetDnsZone_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// 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 WorkloadNetworksGetDnsZone_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); + } + } + + /// Get a gateway by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Gateway identifier. Generally the same as the Gateway's display name + /// 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.VMware.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 WorkloadNetworksGetGateway(string subscriptionId, string resourceGroupName, string privateCloudName, string gatewayId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetGateway_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a gateway by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetGatewayViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/gateways/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetGateway_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a gateway by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetGatewayViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/gateways/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var gatewayId = _match.Groups["gatewayId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/gateways/" + + gatewayId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetGatewayWithResult_Call (request, eventListener,sender); + } + } + + /// Get a gateway by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Gateway identifier. Generally the same as the Gateway's display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetGatewayWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/gateways/" + + global::System.Uri.EscapeDataString(gatewayId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetGatewayWithResult_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.VMware.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 WorkloadNetworksGetGatewayWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetGateway_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Gateway identifier. Generally the same as the Gateway's display name + /// 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 WorkloadNetworksGetGateway_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + } + } + + /// Get a port mirroring profile by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// 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.VMware.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 WorkloadNetworksGetPortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetPortMirroring_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a port mirroring profile by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetPortMirroringViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetPortMirroring_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a port mirroring profile by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetPortMirroringViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetPortMirroringWithResult_Call (request, eventListener,sender); + } + } + + /// Get a port mirroring profile by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetPortMirroringWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetPortMirroringWithResult_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.VMware.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 WorkloadNetworksGetPortMirroringWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetPortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// 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 WorkloadNetworksGetPortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); + } + } + + /// Get a Public IP Block by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// 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.VMware.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 WorkloadNetworksGetPublicIP(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/publicIPs/" + + global::System.Uri.EscapeDataString(publicIPId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetPublicIP_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a Public IP Block by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetPublicIPViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var publicIPId = _match.Groups["publicIPId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/publicIPs/" + + publicIPId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetPublicIP_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a Public IP Block by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetPublicIPViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var publicIPId = _match.Groups["publicIPId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/publicIPs/" + + publicIPId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetPublicIPWithResult_Call (request, eventListener,sender); + } + } + + /// Get a Public IP Block by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetPublicIPWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/publicIPs/" + + global::System.Uri.EscapeDataString(publicIPId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetPublicIPWithResult_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.VMware.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 WorkloadNetworksGetPublicIPWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetPublicIP_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// 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 WorkloadNetworksGetPublicIP_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(publicIPId),publicIPId); + } + } + + /// Get a segment by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// 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.VMware.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 WorkloadNetworksGetSegment(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/segments/" + + global::System.Uri.EscapeDataString(segmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetSegment_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a segment by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetSegmentViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var segmentId = _match.Groups["segmentId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments/" + + segmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetSegment_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a segment by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetSegmentViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var segmentId = _match.Groups["segmentId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments/" + + segmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetSegmentWithResult_Call (request, eventListener,sender); + } + } + + /// Get a segment by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetSegmentWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/segments/" + + global::System.Uri.EscapeDataString(segmentId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetSegmentWithResult_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.VMware.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 WorkloadNetworksGetSegmentWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetSegment_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Segment identifier. Generally the same as the Segment's display name + /// 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 WorkloadNetworksGetSegment_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(segmentId),segmentId); + } + } + + /// Get a vm group by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// 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.VMware.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 WorkloadNetworksGetVMGroup(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/vmGroups/" + + global::System.Uri.EscapeDataString(vmGroupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetVMGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a vm group by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetVMGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var vmGroupId = _match.Groups["vmGroupId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups/" + + vmGroupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetVMGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a vm group by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetVMGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var vmGroupId = _match.Groups["vmGroupId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups/" + + vmGroupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetVMGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a vm group by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetVMGroupWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/vmGroups/" + + global::System.Uri.EscapeDataString(vmGroupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetVMGroupWithResult_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.VMware.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 WorkloadNetworksGetVMGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGetVMGroup_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// 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 WorkloadNetworksGetVMGroup_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); + } + } + + /// Get a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var workloadNetworkName = _match.Groups["workloadNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/" + + workloadNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var workloadNetworkName = _match.Groups["workloadNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/" + + workloadNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Virtual Machine identifier + /// 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.VMware.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 WorkloadNetworksGetVirtualMachine(string subscriptionId, string resourceGroupName, string privateCloudName, string virtualMachineId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetVirtualMachine_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud workload network. + /// + /// 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.VMware.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 WorkloadNetworksGetVirtualMachineViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/virtualMachines/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var virtualMachineId = _match.Groups["virtualMachineId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/virtualMachines/" + + virtualMachineId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksGetVirtualMachine_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetVirtualMachineViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/virtualMachines/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var virtualMachineId = _match.Groups["virtualMachineId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/virtualMachines/" + + virtualMachineId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetVirtualMachineWithResult_Call (request, eventListener,sender); + } + } + + /// Get a virtual machine by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Virtual Machine identifier + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetVirtualMachineWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetVirtualMachineWithResult_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.VMware.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 WorkloadNetworksGetVirtualMachineWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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. @@ -16429,7 +30493,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksDeleteSegment_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksGetVirtualMachine_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16440,106 +30504,188 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// Virtual Machine identifier + /// 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 WorkloadNetworksGetVirtualMachine_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(virtualMachineId),virtualMachineId); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// Get a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var workloadNetworkName = @"default"; + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/" + + global::System.Uri.EscapeDataString(workloadNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksGetWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksGet_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -16547,19 +30693,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16575,18 +30715,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Segment identifier. Generally the same as the Segment's display name /// 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 WorkloadNetworksDeleteSegment_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksGet_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16596,17 +30735,15 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(segmentId),segmentId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Delete a vm group by id in a private cloud workload network. + /// List of workload networks in a private cloud. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX VM Group identifier. Generally the same as the VM Group's display name /// Name of the private cloud /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16614,9 +30751,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteVMGroup(string subscriptionId, string resourceGroupName, string vmGroupId, string privateCloudName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksList(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16628,8 +30765,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/vmGroups/" - + global::System.Uri.EscapeDataString(vmGroupId) + + "/workloadNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16638,19 +30774,62 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteVMGroup_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkloadNetworksList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete a vm group by id in a private cloud workload network. + /// List dhcp in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// 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.VMware.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 WorkloadNetworksListDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksListDhcp_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List dhcp in a private cloud workload network. /// /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -16658,24 +30837,23 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksDeleteVMGroupViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDhcpViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var vmGroupId = _match.Groups["vmGroupId"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -16685,8 +30863,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/vmGroups/" - + vmGroupId + + "/workloadNetworks/default/dhcpConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16695,137 +30872,191 @@ public partial class VMware // 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.VMware.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksDeleteVMGroup_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.WorkloadNetworksListDhcp_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 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// List dhcp in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksDeleteVMGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDhcpViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + // 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListDhcpWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// List dhcp in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDhcpWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dhcpConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); 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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListDhcpWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDhcpWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_finalUri)) + default: { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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.VMware.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 WorkloadNetworksListDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -16833,19 +31064,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcpList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16861,18 +31086,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX VM Group identifier. Generally the same as the VM Group's display name /// Name of the private cloud /// 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 WorkloadNetworksDeleteVMGroup_Validate(string subscriptionId, string resourceGroupName, string vmGroupId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16881,15 +31105,14 @@ public partial class VMware await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Get dhcp by id in a private cloud workload network. + /// List of DNS services in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX DHCP identifier. Generally the same as the DHCP display name /// Name of the private cloud /// 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 @@ -16899,9 +31122,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetDhcp(string subscriptionId, string resourceGroupName, string dhcpId, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsServices(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -16913,8 +31136,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dhcpConfigurations/" - + global::System.Uri.EscapeDataString(dhcpId) + + "/workloadNetworks/default/dnsServices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16928,11 +31150,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetDhcp_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListDnsServices_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get dhcp by id in a private cloud workload network. + /// List of DNS services in a private cloud workload network. /// /// 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 @@ -16942,24 +31164,23 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetDhcpViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsServicesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var dhcpId = _match.Groups["dhcpId"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( @@ -16969,8 +31190,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dhcpConfigurations/" - + dhcpId + + "/workloadNetworks/default/dnsServices" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16984,11 +31204,167 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetDhcp_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListDnsServices_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List of DNS services in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDnsServicesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListDnsServicesWithResult_Call (request, eventListener,sender); + } + } + + /// List of DNS services in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDnsServicesWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListDnsServicesWithResult_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.VMware.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 WorkloadNetworksListDnsServicesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServicesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -16998,7 +31374,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksGetDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListDnsServices_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17009,6 +31385,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -17016,13 +31393,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsServicesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -17038,18 +31415,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// NSX DHCP identifier. Generally the same as the DHCP display name /// Name of the private cloud /// 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 WorkloadNetworksGetDhcp_Validate(string subscriptionId, string resourceGroupName, string dhcpId, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListDnsServices_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -17058,16 +31434,15 @@ public partial class VMware await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Get a DNS service by id in a private cloud workload network. + /// List of DNS zones in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name /// 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). @@ -17076,9 +31451,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetDnsService(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZones(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17090,8 +31465,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsServices/" - + global::System.Uri.EscapeDataString(dnsServiceId) + + "/workloadNetworks/default/dnsZones" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17105,11 +31479,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetDnsService_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListDnsZones_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a DNS service by id in a private cloud workload network. + /// List of DNS zones in a private cloud workload network. /// /// 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 @@ -17119,25 +31493,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetDnsServiceViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZonesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var dnsServiceId = _match.Groups["dnsServiceId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -17146,8 +31519,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsServices/" - + dnsServiceId + + "/workloadNetworks/default/dnsZones" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17161,101 +31533,75 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetDnsService_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListDnsZones_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). + /// List of DNS zones in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsService_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZonesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name - /// 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 WorkloadNetworksGetDnsService_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListDnsZonesWithResult_Call (request, eventListener,sender); } } - /// Get a DNS zone by id in a private cloud workload network. + /// List of DNS zones in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// 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). + /// Name of the private cloud /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsZone(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZonesWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17267,82 +31613,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsZones/" - + global::System.Uri.EscapeDataString(dnsZoneId) + + "/workloadNetworks/default/dnsZones" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksGetDnsZone_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListDnsZonesWithResult_Call (request, eventListener,sender); } } - /// Get a DNS zone by id in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetDnsZoneViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZonesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZonesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var dnsZoneId = _match.Groups["dnsZoneId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/dnsZones/" - + dnsZoneId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksGetDnsZone_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 @@ -17352,7 +31703,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksGetDnsZone_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZones_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17363,6 +31714,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -17370,13 +31722,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZonesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -17392,18 +31744,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name /// 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 WorkloadNetworksGetDnsZone_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZones_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -17413,15 +31764,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Get a gateway by id in a private cloud workload network. + /// List of gateways in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Gateway identifier. Generally the same as the Gateway's display name /// 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). @@ -17430,9 +31780,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetGateway(string subscriptionId, string resourceGroupName, string privateCloudName, string gatewayId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListGateways(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17444,8 +31794,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/gateways/" - + global::System.Uri.EscapeDataString(gatewayId) + + "/workloadNetworks/default/gateways" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17459,11 +31808,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetGateway_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListGateways_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a gateway by id in a private cloud workload network. + /// List of gateways in a private cloud workload network. /// /// 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 @@ -17473,25 +31822,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetGatewayViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListGatewaysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/gateways/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/gateways$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var gatewayId = _match.Groups["gatewayId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -17500,8 +31848,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/gateways/" - + gatewayId + + "/workloadNetworks/default/gateways" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17515,101 +31862,75 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetGateway_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListGateways_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). + /// List of gateways in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetGateway_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListGatewaysViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGateway.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/gateways$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX Gateway identifier. Generally the same as the Gateway's display name - /// 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 WorkloadNetworksGetGateway_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string gatewayId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(gatewayId),gatewayId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/gateways" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListGatewaysWithResult_Call (request, eventListener,sender); } } - /// Get a port mirroring profile by id in a private cloud workload network. + /// List of gateways in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name - /// 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.VMware.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 WorkloadNetworksGetPortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListGatewaysWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17621,82 +31942,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/portMirroringProfiles/" - + global::System.Uri.EscapeDataString(portMirroringId) + + "/workloadNetworks/default/gateways" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksGetPortMirroring_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListGatewaysWithResult_Call (request, eventListener,sender); } } - /// Get a port mirroring profile by id in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetPortMirroringViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListGatewaysWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var portMirroringId = _match.Groups["portMirroringId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/portMirroringProfiles/" - + portMirroringId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksGetPortMirroring_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -17706,7 +32032,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksGetPortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListGateways_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17717,6 +32043,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -17724,13 +32051,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkGatewayList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -17746,18 +32073,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name /// 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 WorkloadNetworksGetPortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListGateways_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -17767,15 +32093,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Get a Public IP Block by id in a private cloud workload network. + /// List of port mirroring profiles in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name /// 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). @@ -17784,9 +32109,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetPublicIP(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListPortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17798,8 +32123,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/publicIPs/" - + global::System.Uri.EscapeDataString(publicIPId) + + "/workloadNetworks/default/portMirroringProfiles" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17813,11 +32137,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetPublicIP_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListPortMirroring_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a Public IP Block by id in a private cloud workload network. + /// List of port mirroring profiles in a private cloud workload network. /// /// 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 @@ -17827,25 +32151,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetPublicIPViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListPortMirroringViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var publicIPId = _match.Groups["publicIPId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -17854,8 +32177,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/publicIPs/" - + publicIPId + + "/workloadNetworks/default/portMirroringProfiles" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17869,11 +32191,167 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetPublicIP_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListPortMirroring_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List of port mirroring profiles in a private cloud workload network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListPortMirroringViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListPortMirroringWithResult_Call (request, eventListener,sender); + } + } + + /// List of port mirroring profiles in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListPortMirroringWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListPortMirroringWithResult_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.VMware.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 WorkloadNetworksListPortMirroringWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -17883,7 +32361,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksGetPublicIP_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListPortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17894,6 +32372,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -17901,13 +32380,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIP.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroringList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -17923,18 +32402,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name /// 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 WorkloadNetworksGetPublicIP_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string publicIPId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListPortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -17944,15 +32422,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(publicIPId),publicIPId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Get a segment by id in a private cloud workload network. + /// List of Public IP Blocks in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Segment identifier. Generally the same as the Segment's display name /// 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). @@ -17961,9 +32438,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetSegment(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPs(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -17975,8 +32452,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/segments/" - + global::System.Uri.EscapeDataString(segmentId) + + "/workloadNetworks/default/publicIPs" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17990,11 +32466,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetSegment_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListPublicIPs_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a segment by id in a private cloud workload network. + /// List of Public IP Blocks in a private cloud workload network. /// /// 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 @@ -18004,25 +32480,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetSegmentViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var segmentId = _match.Groups["segmentId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -18031,8 +32506,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/segments/" - + segmentId + + "/workloadNetworks/default/publicIPs" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18046,101 +32520,75 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetSegment_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListPublicIPs_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). + /// List of Public IP Blocks in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetSegment_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX Segment identifier. Generally the same as the Segment's display name - /// 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 WorkloadNetworksGetSegment_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(segmentId),segmentId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/publicIPs" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListPublicIPsWithResult_Call (request, eventListener,sender); } } - /// Get a vm group by id in a private cloud workload network. + /// List of Public IP Blocks in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX VM Group identifier. Generally the same as the VM Group's display name - /// 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.VMware.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 WorkloadNetworksGetVMGroup(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18152,82 +32600,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/vmGroups/" - + global::System.Uri.EscapeDataString(vmGroupId) + + "/workloadNetworks/default/publicIPs" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksGetVMGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListPublicIPsWithResult_Call (request, eventListener,sender); } } - /// Get a vm group by id in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetVMGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var vmGroupId = _match.Groups["vmGroupId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/vmGroups/" - + vmGroupId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksGetVMGroup_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 @@ -18237,7 +32690,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksGetVMGroup_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPs_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18248,6 +32701,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -18255,13 +32709,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIPsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -18277,18 +32731,17 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX VM Group identifier. Generally the same as the VM Group's display name /// 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 WorkloadNetworksGetVMGroup_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPs_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18298,15 +32751,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// Get a virtual machine by id in a private cloud workload network. + /// List of segments in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// Virtual Machine identifier /// 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). @@ -18315,9 +32767,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetVirtualMachine(string subscriptionId, string resourceGroupName, string privateCloudName, string virtualMachineId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListSegments(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18329,8 +32781,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineId) + + "/workloadNetworks/default/segments" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18344,11 +32795,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetVirtualMachine_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListSegments_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a virtual machine by id in a private cloud workload network. + /// List of segments in a private cloud workload network. /// /// 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 @@ -18358,25 +32809,24 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksGetVirtualMachineViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListSegmentsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var virtualMachineId = _match.Groups["virtualMachineId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -18385,8 +32835,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/virtualMachines/" - + virtualMachineId + + "/workloadNetworks/default/segments" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18400,100 +32849,75 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksGetVirtualMachine_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListSegments_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). + /// List of segments in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksGetVirtualMachine_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListSegmentsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// Virtual Machine identifier - /// 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 WorkloadNetworksGetVirtualMachine_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string virtualMachineId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(virtualMachineId),virtualMachineId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListSegmentsWithResult_Call (request, eventListener,sender); } } - /// List dhcp in a private cloud workload network. + /// List of segments in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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.VMware.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 WorkloadNetworksListDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListSegmentsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18505,79 +32929,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dhcpConfigurations" + + "/workloadNetworks/default/segments" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksListDhcp_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListSegmentsWithResult_Call (request, eventListener,sender); } } - /// List dhcp in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDhcpViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListSegmentsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/dhcpConfigurations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksListDhcp_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -18587,7 +33019,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListSegments_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18598,6 +33030,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -18605,13 +33038,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcpList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegmentsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -18627,8 +33060,8 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -18637,7 +33070,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListSegments_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18647,10 +33080,11 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// List of DNS services in a private cloud workload network. + /// List of vm groups in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud @@ -18662,9 +33096,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsServices(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroups(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18676,7 +33110,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsServices" + + "/workloadNetworks/default/vmGroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18690,11 +33124,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListDnsServices_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListVMGroups_Call (request, onOk,onDefault,eventListener,sender); } } - /// List of DNS services in a private cloud workload network. + /// List of vm groups in a private cloud workload network. /// /// 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 @@ -18704,18 +33138,18 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksListDnsServicesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroupsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups'"); } // replace URI parameters with values from identity @@ -18730,7 +33164,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsServices" + + "/workloadNetworks/default/vmGroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18744,98 +33178,75 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListDnsServices_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListVMGroups_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). + /// List of vm groups in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDnsServices_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroupsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsServicesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 WorkloadNetworksListDnsServices_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListVMGroupsWithResult_Call (request, eventListener,sender); } } - /// List of DNS zones in a private cloud workload network. + /// List of vm groups in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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.VMware.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 WorkloadNetworksListDnsZones(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroupsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -18847,79 +33258,87 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsZones" + + "/workloadNetworks/default/vmGroups" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksListDnsZones_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListVMGroupsWithResult_Call (request, eventListener,sender); } } - /// List of DNS zones in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDnsZonesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroupsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/dnsZones" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksListDnsZones_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 @@ -18929,7 +33348,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListDnsZones_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroups_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18940,6 +33359,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -18947,13 +33367,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZonesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroupsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -18969,7 +33389,7 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will + /// Validation method for method. Call this like the actual call, but you will /// get validation events back. /// /// The ID of the target subscription. @@ -18977,22 +33397,129 @@ public partial class VMware /// Name of the private cloud /// an instance that will receive events. /// - /// 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 WorkloadNetworksListVMGroups_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + } + } + + /// List of workload networks in a private cloud. + /// + /// 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.VMware.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 WorkloadNetworksListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// List of workload networks in a private cloud. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListDnsZones_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task WorkloadNetworksListViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListWithResult_Call (request, eventListener,sender); } } - /// List of gateways in a private cloud workload network. + /// List of virtual machines in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud @@ -19004,9 +33531,9 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksListGateways(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachines(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19018,7 +33545,7 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/gateways" + + "/workloadNetworks/default/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19032,11 +33559,11 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListGateways_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListVirtualMachines_Call (request, onOk,onDefault,eventListener,sender); } } - /// List of gateways in a private cloud workload network. + /// List of virtual machines in a private cloud workload network. /// /// 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 @@ -19046,18 +33573,18 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task WorkloadNetworksListGatewaysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachinesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/gateways$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/virtualMachines$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines'"); } // replace URI parameters with values from identity @@ -19072,7 +33599,7 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/gateways" + + "/workloadNetworks/default/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19086,98 +33613,75 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListGateways_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksListVirtualMachines_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). + /// List of virtual machines in a private cloud workload network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListGateways_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachinesViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkGatewayList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 WorkloadNetworksListGateways_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksListVirtualMachinesWithResult_Call (request, eventListener,sender); } } - /// List of port mirroring profiles in a private cloud workload network. + /// List of virtual machines in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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.VMware.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 WorkloadNetworksListPortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachinesWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19189,79 +33693,89 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/portMirroringProfiles" + + "/workloadNetworks/default/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksListPortMirroring_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListVirtualMachinesWithResult_Call (request, eventListener,sender); } } - /// List of port mirroring profiles in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListPortMirroringViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachinesWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachinesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/portMirroringProfiles" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksListPortMirroring_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 @@ -19271,7 +33785,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListPortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachines_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -19282,6 +33796,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -19289,13 +33804,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroringList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVirtualMachinesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -19311,7 +33826,7 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you + /// Validation method for method. Call this like the actual call, but you /// will get validation events back. /// /// The ID of the target subscription. @@ -19321,7 +33836,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListPortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListVirtualMachines_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -19331,24 +33846,23 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// List of Public IP Blocks in a private cloud workload network. + /// List of workload networks in a private cloud. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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.VMware.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 WorkloadNetworksListPublicIPs(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksListWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19360,79 +33874,85 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/publicIPs" + + "/workloadNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksListPublicIPs_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksListWithResult_Call (request, eventListener,sender); } } - /// List of Public IP Blocks in a private cloud workload network. - /// - /// 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListPublicIPsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/publicIPs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/publicIPs" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksListPublicIPs_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 @@ -19442,7 +33962,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPs_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksList_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -19453,6 +33973,7 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -19460,13 +33981,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIPsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -19482,8 +34003,8 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. @@ -19492,7 +34013,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListPublicIPs_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksList_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -19502,24 +34023,28 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); } } - /// List of segments in a private cloud workload network. + /// Update dhcp by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// NSX DHCP /// 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.VMware.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 WorkloadNetworksListSegments(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19531,7 +34056,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/segments" + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19540,43 +34066,50 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListSegments_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateDhcp_Call (request, onOk,onDefault,eventListener,sender); } } - /// List of segments in a private cloud workload network. + /// Update dhcp by id in a private cloud workload network. /// + /// NSX DHCP /// 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.VMware.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 WorkloadNetworksListSegmentsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcpViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -19585,7 +34118,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/segments" + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19594,103 +34128,95 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListSegments_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateDhcp_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). + /// Update dhcp by id in a private cloud workload network. + /// + /// NSX DHCP /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListSegments_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcpViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegmentsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 WorkloadNetworksListSegments_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dhcpId = _match.Groups["dhcpId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dhcpConfigurations/" + + dhcpId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateDhcpWithResult_Call (request, eventListener,sender); } } - /// List of vm groups in a private cloud workload network. + /// Update dhcp by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// 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). + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// NSX DHCP /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListVMGroups(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcpWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19702,79 +34228,183 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/vmGroups" + + "/workloadNetworks/default/dhcpConfigurations/" + + global::System.Uri.EscapeDataString(dhcpId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksListVMGroups_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksUpdateDhcpWithResult_Call (request, eventListener,sender); } } - /// List of vm groups in a private cloud workload network. - /// - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListVMGroupsViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcpWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups'"); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/vmGroups" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // 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.VMware.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksListVMGroups_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -19784,7 +34414,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksListVMGroups_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -19793,8 +34423,100 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -19802,13 +34524,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroupsList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -19824,17 +34546,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// NSX DHCP identifier. Generally the same as the DHCP display name + /// NSX DHCP /// 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 WorkloadNetworksListVMGroups_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -19844,24 +34568,31 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// List of virtual machines in a private cloud workload network. + /// Update a DNS service by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// NSX DNS Service /// 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.VMware.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 WorkloadNetworksListVirtualMachines(string subscriptionId, string resourceGroupName, string privateCloudName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsService(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -19873,7 +34604,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/virtualMachines" + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19882,43 +34614,50 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListVirtualMachines_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateDnsService_Call (request, onOk,onDefault,eventListener,sender); } } - /// List of virtual machines in a private cloud workload network. + /// Update a DNS service by id in a private cloud workload network. /// + /// NSX DNS Service /// 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.VMware.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 WorkloadNetworksListVirtualMachinesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsServiceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -19927,7 +34666,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/virtualMachines" + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19936,105 +34676,95 @@ public partial class VMware // 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.VMware.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksListVirtualMachines_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateDnsService_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). + /// Update a DNS service by id in a private cloud workload network. + /// + /// NSX DNS Service /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksListVirtualMachines_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsServiceViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVirtualMachinesList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// 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 WorkloadNetworksListVirtualMachines_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsServiceId = _match.Groups["dnsServiceId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsServices/" + + dnsServiceId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateDnsServiceWithResult_Call (request, eventListener,sender); } } - /// Create or update dhcp by id in a private cloud workload network. + /// Update a DNS service by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// NSX DHCP - /// 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). + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// NSX DNS Service /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateDhcp(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsServiceWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20046,91 +34776,183 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dhcpConfigurations/" - + global::System.Uri.EscapeDataString(dhcpId) + + "/workloadNetworks/default/dnsServices/" + + global::System.Uri.EscapeDataString(dnsServiceId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksUpdateDhcp_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksUpdateDnsServiceWithResult_Call (request, eventListener,sender); } } - /// Create or update dhcp by id in a private cloud workload network. - /// - /// NSX DHCP - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateDhcpViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsServiceWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dhcpConfigurations/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}'"); - } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var dhcpId = _match.Groups["dhcpId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/dhcpConfigurations/" - + dhcpId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - // 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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksUpdateDhcp_Call(request,onOk,onDefault,eventListener,sender); + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -20140,7 +34962,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDhcp_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsService_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20149,6 +34971,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -20158,13 +34981,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -20178,10 +34996,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -20190,45 +35004,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -20250,6 +35064,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -20257,13 +35072,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -20279,19 +35094,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DHCP identifier. Generally the same as the DHCP display name - /// NSX DHCP + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// NSX DNS Service /// 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 WorkloadNetworksUpdateDhcp_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dhcpId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsService_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20301,29 +35116,31 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dhcpId),dhcpId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create or update a DNS service by id in a private cloud workload network. + /// Update a DNS zone by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name - /// NSX DNS Service + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// NSX DNS Zone /// 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.VMware.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 WorkloadNetworksUpdateDnsService(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsZone(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20335,8 +35152,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsServices/" - + global::System.Uri.EscapeDataString(dnsServiceId) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20350,44 +35167,45 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdateDnsService_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateDnsZone_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a DNS service by id in a private cloud workload network. + /// Update a DNS zone by id in a private cloud workload network. /// - /// NSX DNS Service + /// NSX DNS Zone /// 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.VMware.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 WorkloadNetworksUpdateDnsServiceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsZoneViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var dnsServiceId = _match.Groups["dnsServiceId"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20396,30 +35214,293 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsServices/" - + dnsServiceId + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.WorkloadNetworksUpdateDnsZone_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Update a DNS zone by id in a private cloud workload network. + /// + /// NSX DNS Zone + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateDnsZoneViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var dnsZoneId = _match.Groups["dnsZoneId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/dnsZones/" + + dnsZoneId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateDnsZoneWithResult_Call (request, eventListener,sender); + } + } + + /// Update a DNS zone by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// NSX DNS Zone + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateDnsZoneWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/dnsZones/" + + global::System.Uri.EscapeDataString(dnsZoneId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateDnsZoneWithResult_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.VMware.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 WorkloadNetworksUpdateDnsZoneWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } - // 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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksUpdateDnsService_Call(request,onOk,onDefault,eventListener,sender); + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -20429,7 +35510,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsService_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsZone_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20438,6 +35519,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -20447,13 +35529,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -20467,10 +35544,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -20479,45 +35552,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -20539,6 +35612,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -20546,13 +35620,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -20568,19 +35642,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Service identifier. Generally the same as the DNS Service's display name - /// NSX DNS Service + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + /// NSX DNS Zone /// 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 WorkloadNetworksUpdateDnsService_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsServiceId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsZone_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20590,29 +35664,31 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dnsServiceId),dnsServiceId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create or update a DNS zone by id in a private cloud workload network. + /// Update a port mirroring profile by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// NSX DNS Zone + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// NSX port mirroring /// 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.VMware.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 WorkloadNetworksUpdateDnsZone(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdatePortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20624,8 +35700,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/dnsZones/" - + global::System.Uri.EscapeDataString(dnsZoneId) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20639,44 +35715,45 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdateDnsZone_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdatePortMirroring_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a DNS zone by id in a private cloud workload network. + /// Update a port mirroring profile by id in a private cloud workload network. /// - /// NSX DNS Zone + /// NSX port mirroring /// 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.VMware.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 WorkloadNetworksUpdateDnsZoneViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdatePortMirroringViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/dnsZones/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var dnsZoneId = _match.Groups["dnsZoneId"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20685,8 +35762,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/dnsZones/" - + dnsZoneId + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20700,15 +35777,280 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdateDnsZone_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdatePortMirroring_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Update a port mirroring profile by id in a private cloud workload network. + /// + /// NSX port mirroring + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdatePortMirroringViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var portMirroringId = _match.Groups["portMirroringId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/portMirroringProfiles/" + + portMirroringId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdatePortMirroringWithResult_Call (request, eventListener,sender); + } + } + + /// Update a port mirroring profile by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// NSX port mirroring + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdatePortMirroringWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/portMirroringProfiles/" + + global::System.Uri.EscapeDataString(portMirroringId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdatePortMirroringWithResult_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.VMware.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 WorkloadNetworksUpdatePortMirroringWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -20718,7 +36060,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateDnsZone_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdatePortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -20727,6 +36069,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -20736,13 +36079,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -20756,10 +36094,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -20768,45 +36102,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -20828,6 +36162,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -20835,13 +36170,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -20857,19 +36192,19 @@ public partial class VMware } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. /// /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name - /// NSX DNS Zone + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// NSX port mirroring /// 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 WorkloadNetworksUpdateDnsZone_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string dnsZoneId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdatePortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20879,31 +36214,31 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(dnsZoneId),dnsZoneId); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); + await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Create or update a port mirroring profile by id in a private cloud workload network. - /// + /// Update a segment by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name - /// NSX port mirroring + /// NSX Segment identifier. Generally the same as the Segment's display name + /// NSX Segment /// 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.VMware.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 WorkloadNetworksUpdatePortMirroring(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegments(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -20915,8 +36250,8 @@ public partial class VMware + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.AVS/privateClouds/" + global::System.Uri.EscapeDataString(privateCloudName) - + "/workloadNetworks/default/portMirroringProfiles/" - + global::System.Uri.EscapeDataString(portMirroringId) + + "/workloadNetworks/default/segments/" + + global::System.Uri.EscapeDataString(segmentId) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20930,46 +36265,45 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdatePortMirroring_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateSegments_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Create or update a port mirroring profile by id in a private cloud workload network. - /// + /// Update a segment by id in a private cloud workload network. /// - /// NSX port mirroring + /// NSX Segment /// 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.VMware.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 WorkloadNetworksUpdatePortMirroringViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/portMirroringProfiles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; var privateCloudName = _match.Groups["privateCloudName"].Value; - var portMirroringId = _match.Groups["portMirroringId"].Value; + var segmentId = _match.Groups["segmentId"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -20978,8 +36312,8 @@ public partial class VMware + resourceGroupName + "/providers/Microsoft.AVS/privateClouds/" + privateCloudName - + "/workloadNetworks/default/portMirroringProfiles/" - + portMirroringId + + "/workloadNetworks/default/segments/" + + segmentId + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20993,208 +36327,90 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdatePortMirroring_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateSegments_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). + /// Update a segment by id in a private cloud workload network. + /// + /// NSX Segment /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdatePortMirroring_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegmentsViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2023-03-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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: default - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + // verify that Identity format is an exact match for uri - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - if (!string.IsNullOrWhiteSpace(_originalUri)) - { - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); + } - // drop the old response - _response?.Dispose(); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var segmentId = _match.Groups["segmentId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/segments/" + + segmentId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + // 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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// Name of the private cloud - /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name - /// NSX port mirroring - /// 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 WorkloadNetworksUpdatePortMirroring_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string portMirroringId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); - await eventListener.AssertNotNull(nameof(portMirroringId),portMirroringId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateSegmentsWithResult_Call (request, eventListener,sender); } } - /// Create or update a segment by id in a private cloud workload network. + /// Update a segment by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud /// NSX Segment identifier. Generally the same as the Segment's display name /// NSX Segment - /// 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.VMware.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 WorkloadNetworksUpdateSegments(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegmentsWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21212,85 +36428,177 @@ public partial class VMware + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.WorkloadNetworksUpdateSegments_Call(request,onOk,onDefault,eventListener,sender); + return await this.WorkloadNetworksUpdateSegmentsWithResult_Call (request, eventListener,sender); } } - /// Create or update a segment by id in a private cloud workload network. - /// - /// NSX Segment - /// 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateSegmentsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegmentsWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { - var apiVersion = @"2021-12-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/segments/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}'"); - } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var privateCloudName = _match.Groups["privateCloudName"].Value; - var segmentId = _match.Groups["segmentId"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.AVS/privateClouds/" - + privateCloudName - + "/workloadNetworks/default/segments/" - + segmentId - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); - // 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.VMware.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.WorkloadNetworksUpdateSegments_Call(request,onOk,onDefault,eventListener,sender); + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -21300,7 +36608,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegments_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegments_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21309,6 +36617,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -21318,13 +36627,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -21338,10 +36642,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -21350,45 +36650,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -21410,6 +36710,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -21417,13 +36718,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -21451,7 +36752,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegments_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateSegments_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string segmentId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21461,13 +36762,14 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(segmentId),segmentId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create or update a vm group by id in a private cloud workload network. + /// Update a vm group by id in a private cloud workload network. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// Name of the private cloud @@ -21478,12 +36780,13 @@ public partial class VMware /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateVMGroup(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateVMGroup(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21510,15 +36813,15 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdateVMGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateVMGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create or update a vm group by id in a private cloud workload network. + /// Update a vm group by id in a private cloud workload network. /// /// NSX VM Group /// a delegate that is called when the remote service returns 200 (OK). @@ -21526,12 +36829,13 @@ public partial class VMware /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateVMGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task WorkloadNetworksUpdateVMGroupViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) { - var apiVersion = @"2021-12-01"; + var apiVersion = @"2023-03-01"; // Constant Parameters using( NoSynchronizationContext ) { @@ -21571,15 +36875,278 @@ public partial class VMware await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.WorkloadNetworksUpdateVMGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.WorkloadNetworksUpdateVMGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Update a vm group by id in a private cloud workload network. + /// + /// NSX VM Group + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateVMGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/(?[^/]+)/workloadNetworks/default/vmGroups/(?[^/]+)$", 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.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var privateCloudName = _match.Groups["privateCloudName"].Value; + var vmGroupId = _match.Groups["vmGroupId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.AVS/privateClouds/" + + privateCloudName + + "/workloadNetworks/default/vmGroups/" + + vmGroupId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateVMGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Update a vm group by id in a private cloud workload network. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Name of the private cloud + /// NSX VM Group identifier. Generally the same as the VM Group's display name + /// NSX VM Group + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.VMware.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 WorkloadNetworksUpdateVMGroupWithResult(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2023-03-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.AVS/privateClouds/" + + global::System.Uri.EscapeDataString(privateCloudName) + + "/workloadNetworks/default/vmGroups/" + + global::System.Uri.EscapeDataString(vmGroupId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.WorkloadNetworksUpdateVMGroupWithResult_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.VMware.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 WorkloadNetworksUpdateVMGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.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 @@ -21589,7 +37156,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateVMGroup_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateVMGroup_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.VMware.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21598,6 +37165,7 @@ public partial class VMware { var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation @@ -21607,13 +37175,8 @@ public partial class VMware var location = _response.GetFirstHeader(@"Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -21627,10 +37190,6 @@ public partial class VMware // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -21639,45 +37198,45 @@ public partial class VMware _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -21699,6 +37258,7 @@ public partial class VMware break; } } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -21706,13 +37266,13 @@ public partial class VMware case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -21740,7 +37300,7 @@ public partial class VMware /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateVMGroup_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task WorkloadNetworksUpdateVMGroup_Validate(string subscriptionId, string resourceGroupName, string privateCloudName, string vmGroupId, Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup body, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21750,6 +37310,7 @@ public partial class VMware await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(privateCloudName),privateCloudName); + await eventListener.AssertRegEx(nameof(privateCloudName), privateCloudName, @"^[-\w\._]+$"); await eventListener.AssertNotNull(nameof(vmGroupId),vmGroupId); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_Get.cs index a8ca59a48a60..29bd7cb66895 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an addon by name in a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAddon_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an addon by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareAddon_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareAddon_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -92,7 +115,7 @@ public partial class GetAzVMwareAddon_Get : global::System.Management.Automation /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -152,7 +175,8 @@ public partial class GetAzVMwareAddon_Get : global::System.Management.Automation [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +185,24 @@ public partial class GetAzVMwareAddon_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddon + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon /// 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) @@ -201,11 +225,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareAddon_Get() { @@ -256,8 +284,33 @@ public GetAzVMwareAddon_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -310,7 +363,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -331,7 +384,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +407,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -376,15 +429,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -394,12 +447,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.VMware.Models.Api20211201.IAddon + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon /// 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 ) { @@ -411,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentity.cs index ff6194b726d9..c3a67550fd11 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an addon by name in a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAddon_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an addon by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareAddon_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareAddon_GetViaIdentity : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareAddon_GetViaIdentity : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareAddon_GetViaIdentity : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddon + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareAddon_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareAddon_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IAddon + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..e47d04448a24 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,469 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get an addon by name in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAddon_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an addon by name in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareAddon_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the addon for the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the addon for the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the addon for the private cloud", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AddonName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IAddon + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareAddon_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/addons/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AddonsGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.AddonsGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IAddon + /// 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.VMware.Models.IAddon + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_List.cs index fea495c1c714..8230e1607f96 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAddon_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List addons in a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAddon_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List addons in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons", ApiVersion = "2023-03-01")] public partial class GetAzVMwareAddon_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareAddon_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareAddon_List : global::System.Management.Automatio /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareAddon_List : global::System.Management.Automatio [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareAddon_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddonList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareAddon_List() { @@ -247,8 +275,33 @@ public GetAzVMwareAddon_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IAddonList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_Get.cs index 4f2039082503..8a6589ad3bc4 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an ExpressRoute Circuit Authorization by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAuthorization_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an ExpressRoute Circuit Authorization by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareAuthorization_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareAuthorization_Get : global::System.Management.Au /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -91,7 +114,7 @@ public partial class GetAzVMwareAuthorization_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareAuthorization_Get : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareAuthorization_Get : global::System.Management.Au /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorization + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareAuthorization_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareAuthorization_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IExpressRouteAuthorization + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentity.cs index d4e4c013c716..3efe26d10d4b 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an ExpressRoute Circuit Authorization by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAuthorization_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an ExpressRoute Circuit Authorization by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareAuthorization_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareAuthorization_GetViaIdentity : global::System.Ma /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwareAuthorization_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwareAuthorization_GetViaIdentity : global::System.Ma /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorization + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareAuthorization_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwareAuthorization_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -298,7 +350,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -321,12 +373,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -343,7 +395,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -361,12 +413,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.VMware.Models.Api20211201.IExpressRouteAuthorization + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization /// 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 ) { @@ -378,8 +430,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..f8dad5b7a3b2 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get an ExpressRoute Circuit Authorization by name in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAuthorization_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an ExpressRoute Circuit Authorization by name in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareAuthorization_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the ExpressRoute Circuit Authorization in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the ExpressRoute Circuit Authorization in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the ExpressRoute Circuit Authorization in the private cloud", + SerializedName = @"authorizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AuthorizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareAuthorization_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/authorizations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AuthorizationsGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.AuthorizationsGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_List.cs index 7da0952dc95e..37f498eb8272 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareAuthorization_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List ExpressRoute Circuit Authorizations in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareAuthorization_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List ExpressRoute Circuit Authorizations in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations", ApiVersion = "2023-03-01")] public partial class GetAzVMwareAuthorization_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,29 +37,48 @@ public partial class GetAzVMwareAuthorization_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -82,7 +105,7 @@ public partial class GetAzVMwareAuthorization_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -142,7 +165,8 @@ public partial class GetAzVMwareAuthorization_List : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -151,24 +175,24 @@ public partial class GetAzVMwareAuthorization_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorizationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList /// 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) @@ -191,11 +215,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareAuthorization_List() { @@ -246,8 +274,33 @@ public GetAzVMwareAuthorization_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +353,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +397,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -366,15 +419,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -384,12 +437,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.VMware.Models.Api20211201.IExpressRouteAuthorizationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList /// 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 ) { @@ -401,15 +454,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorizationList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_Get.cs index 84ab4f7a2612..25dfb20f2794 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an cloud link by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCloudLink_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an cloud link by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareCloudLink_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareCloudLink_Get : global::System.Management.Automa /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -91,7 +114,7 @@ public partial class GetAzVMwareCloudLink_Get : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareCloudLink_Get : global::System.Management.Automa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareCloudLink_Get : global::System.Management.Automa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareCloudLink_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareCloudLink_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.ICloudLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentity.cs index 67cd7c329277..7b0ab1895233 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an cloud link by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCloudLink_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an cloud link by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareCloudLink_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareCloudLink_GetViaIdentity : global::System.Manage /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwareCloudLink_GetViaIdentity : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwareCloudLink_GetViaIdentity : global::System.Manage /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareCloudLink_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwareCloudLink_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -298,7 +350,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -321,12 +373,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -343,7 +395,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -361,12 +413,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.VMware.Models.Api20211201.ICloudLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink /// 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 ) { @@ -378,8 +430,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..37616820f60f --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get an cloud link by name in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCloudLink_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an cloud link by name in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareCloudLink_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cloud link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cloud link resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cloud link resource", + SerializedName = @"cloudLinkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudLinkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareCloudLink_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/cloudLinks/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.CloudLinksGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.CloudLinksGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_List.cs index cf8c6e35d255..fb738f019085 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCloudLink_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List cloud link in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCloudLink_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List cloud link in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks", ApiVersion = "2023-03-01")] public partial class GetAzVMwareCloudLink_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,29 +37,48 @@ public partial class GetAzVMwareCloudLink_List : global::System.Management.Autom /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -82,7 +105,7 @@ public partial class GetAzVMwareCloudLink_List : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -142,7 +165,8 @@ public partial class GetAzVMwareCloudLink_List : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -151,24 +175,24 @@ public partial class GetAzVMwareCloudLink_List : global::System.Management.Autom /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLinkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList /// 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) @@ -191,11 +215,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareCloudLink_List() { @@ -246,8 +274,33 @@ public GetAzVMwareCloudLink_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +353,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +397,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -366,15 +419,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -384,12 +437,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.VMware.Models.Api20211201.ICloudLinkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList /// 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 ) { @@ -401,15 +454,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLinkList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareClusterZone_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareClusterZone_List.cs new file mode 100644 index 000000000000..eb981f10a0a2 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareClusterZone_List.cs @@ -0,0 +1,498 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// List hosts by zone in a cluster + /// + /// [OpenAPI] ListZones=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/listZones" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareClusterZone_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List hosts by zone in a cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/listZones", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareClusterZone_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.IClusterZoneList + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareClusterZone_List() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersListZones' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersListZones(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IClusterZoneList + /// 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.VMware.Models.IClusterZoneList + var result = (await response); + // response should be returning an array of some kind. +Pageable + // nested-array / zones / + if (null != result.Zone) + { + if (0 == _responseSize && 1 == result.Zone.Count) + { + _firstResponse = result.Zone[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Zone ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_Get.cs index 917c71ccb852..cf47cfe74c2f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a cluster by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCluster_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a cluster by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareCluster_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareCluster_Get : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -91,7 +114,7 @@ public partial class GetAzVMwareCluster_Get : global::System.Management.Automati /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareCluster_Get : global::System.Management.Automati [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareCluster_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareCluster_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareCluster_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentity.cs index e74237064109..1891ac155ac2 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a cluster by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCluster_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a cluster by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareCluster_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareCluster_GetViaIdentity : global::System.Manageme /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwareCluster_GetViaIdentity : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwareCluster_GetViaIdentity : global::System.Manageme /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareCluster_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwareCluster_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -298,7 +350,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -321,12 +373,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -343,7 +395,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -361,12 +413,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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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 ) { @@ -378,8 +430,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..7569ec68ece8 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a cluster by name in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCluster_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a cluster by name in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareCluster_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareCluster_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ClustersGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ClustersGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_List.cs index 003d92ed76de..9ae7c2f593ae 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareCluster_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List clusters in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareCluster_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List clusters in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters", ApiVersion = "2023-03-01")] public partial class GetAzVMwareCluster_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,29 +37,48 @@ public partial class GetAzVMwareCluster_List : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -82,7 +105,7 @@ public partial class GetAzVMwareCluster_List : global::System.Management.Automat /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -142,7 +165,8 @@ public partial class GetAzVMwareCluster_List : global::System.Management.Automat [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -151,24 +175,24 @@ public partial class GetAzVMwareCluster_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList /// 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) @@ -191,11 +215,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareCluster_List() { @@ -246,8 +274,33 @@ public GetAzVMwareCluster_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +353,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +397,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -366,15 +419,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -384,12 +437,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.VMware.Models.Api20211201.IClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList /// 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 ) { @@ -401,15 +454,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_Get.cs index 7e3d6a489015..0eb5c3dc589c 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a datastore in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareDatastore_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a datastore in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareDatastore_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,11 +37,26 @@ public partial class GetAzVMwareDatastore_Get : global::System.Management.Automa /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -56,14 +75,18 @@ public partial class GetAzVMwareDatastore_Get : global::System.Management.Automa public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class GetAzVMwareDatastore_Get : global::System.Management.Automa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -165,7 +188,8 @@ public partial class GetAzVMwareDatastore_Get : global::System.Management.Automa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -174,24 +198,24 @@ public partial class GetAzVMwareDatastore_Get : global::System.Management.Automa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastore + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore /// 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) @@ -214,11 +238,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareDatastore_Get() { @@ -269,8 +297,33 @@ public GetAzVMwareDatastore_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -323,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -344,7 +397,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -367,12 +420,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -389,15 +442,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + 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 } }); @@ -407,12 +460,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.VMware.Models.Api20211201.IDatastore + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore /// 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 ) { @@ -424,8 +477,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentity.cs index fec18e7d9910..922c7d71a72e 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a datastore in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareDatastore_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a datastore in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareDatastore_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareDatastore_GetViaIdentity : global::System.Manage /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwareDatastore_GetViaIdentity : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwareDatastore_GetViaIdentity : global::System.Manage /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastore + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareDatastore_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwareDatastore_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,7 +354,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -325,12 +377,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -347,7 +399,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -365,12 +417,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.VMware.Models.Api20211201.IDatastore + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore /// 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 ) { @@ -382,8 +434,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentityCluster.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentityCluster.cs new file mode 100644 index 000000000000..c27c77e5a47f --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentityCluster.cs @@ -0,0 +1,472 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a datastore in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareDatastore_GetViaIdentityCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareDatastore_GetViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareDatastore_GetViaIdentityCluster() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DatastoresGetViaIdentity(ClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.DatastoresGet(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..e696b6202cc4 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,482 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a datastore in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareDatastore_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareDatastore_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareDatastore_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DatastoresGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.DatastoresGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_List.cs index b0639f2658ac..f6577d70a75d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareDatastore_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List datastores in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareDatastore_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List datastores in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores", ApiVersion = "2023-03-01")] public partial class GetAzVMwareDatastore_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,17 +37,32 @@ public partial class GetAzVMwareDatastore_List : global::System.Management.Autom /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,14 +81,18 @@ public partial class GetAzVMwareDatastore_List : global::System.Management.Autom public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -96,7 +119,7 @@ public partial class GetAzVMwareDatastore_List : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -156,7 +179,8 @@ public partial class GetAzVMwareDatastore_List : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -165,24 +189,24 @@ public partial class GetAzVMwareDatastore_List : global::System.Management.Autom /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastoreList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList /// 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) @@ -205,11 +229,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareDatastore_List() { @@ -260,8 +288,33 @@ public GetAzVMwareDatastore_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +367,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +388,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -358,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -380,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName }) + 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 } }); @@ -398,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.VMware.Models.Api20211201.IDatastoreList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList /// 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 ) { @@ -415,15 +468,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastoreList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_Get.cs index 582159eabacb..da9ee4d6fba2 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a global reach connection by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareGlobalReachConnection_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a global reach connection by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareGlobalReachConnection_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareGlobalReachConnection_Get : global::System.Manag /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -91,7 +114,7 @@ public partial class GetAzVMwareGlobalReachConnection_Get : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareGlobalReachConnection_Get : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareGlobalReachConnection_Get : global::System.Manag /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareGlobalReachConnection_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareGlobalReachConnection_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IGlobalReachConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentity.cs index 1f5d9700bf3f..71b26efbea32 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a global reach connection by name in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareGlobalReachConnection_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a global reach connection by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareGlobalReachConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareGlobalReachConnection_GetViaIdentity : global::S /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwareGlobalReachConnection_GetViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwareGlobalReachConnection_GetViaIdentity : global::S /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareGlobalReachConnection_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwareGlobalReachConnection_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -298,7 +350,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -321,12 +373,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -343,7 +395,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -361,12 +413,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.VMware.Models.Api20211201.IGlobalReachConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection /// 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 ) { @@ -378,8 +430,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..8fe6598f0f34 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a global reach connection by name in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a global reach connection by name in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the global reach connection in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the global reach connection in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the global reach connection in the private cloud", + SerializedName = @"globalReachConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GlobalReachConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareGlobalReachConnection_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/globalReachConnections/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.GlobalReachConnectionsGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.GlobalReachConnectionsGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_List.cs index f064f80c4831..7c9dc9dbefd8 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareGlobalReachConnection_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List global reach connections in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareGlobalReachConnection_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List global reach connections in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections", ApiVersion = "2023-03-01")] public partial class GetAzVMwareGlobalReachConnection_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,29 +37,48 @@ public partial class GetAzVMwareGlobalReachConnection_List : global::System.Mana /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -82,7 +105,7 @@ public partial class GetAzVMwareGlobalReachConnection_List : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -142,7 +165,8 @@ public partial class GetAzVMwareGlobalReachConnection_List : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -151,24 +175,24 @@ public partial class GetAzVMwareGlobalReachConnection_List : global::System.Mana /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnectionList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList /// 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) @@ -191,11 +215,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareGlobalReachConnection_List() { @@ -246,8 +274,33 @@ public GetAzVMwareGlobalReachConnection_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -300,7 +353,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -321,7 +374,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -344,12 +397,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -366,15 +419,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -384,12 +437,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.VMware.Models.Api20211201.IGlobalReachConnectionList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList /// 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 ) { @@ -401,15 +454,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnectionList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareOperation_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareOperation_List.cs index e09d09b87d07..d935e9887fb7 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareOperation_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Lists all of the available operations @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Lists all of the available operations")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/providers/Microsoft.AVS/operations", ApiVersion = "2023-03-01")] public partial class GetAzVMwareOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareOperation_List : global::System.Management.Autom /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareOperation_List : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -106,24 +129,24 @@ public partial class GetAzVMwareOperation_List : global::System.Management.Autom /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList /// 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) @@ -146,11 +169,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareOperation_List() { @@ -201,8 +228,33 @@ public GetAzVMwareOperation_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -255,7 +307,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -273,7 +325,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -296,12 +348,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -318,7 +370,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -336,12 +388,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.VMware.Models.Api20211201.IOperationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList /// 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 ) { @@ -353,15 +405,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperationList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_Get.cs index 3ddc528f7e5c..641edf790673 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a placement policy by name in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePlacementPolicy_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a placement policy by name in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePlacementPolicy_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,11 +37,26 @@ public partial class GetAzVMwarePlacementPolicy_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -56,14 +75,18 @@ public partial class GetAzVMwarePlacementPolicy_Get : global::System.Management. public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +130,7 @@ public partial class GetAzVMwarePlacementPolicy_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -167,7 +190,8 @@ public partial class GetAzVMwarePlacementPolicy_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -176,24 +200,24 @@ public partial class GetAzVMwarePlacementPolicy_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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) @@ -216,11 +240,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePlacementPolicy_Get() { @@ -271,8 +299,33 @@ public GetAzVMwarePlacementPolicy_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -325,7 +378,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -346,7 +399,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -369,12 +422,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -391,15 +444,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + 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 } }); @@ -409,12 +462,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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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 ) { @@ -426,8 +479,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentity.cs index 3e1b09eeebba..b3e5d80d31f7 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a placement policy by name in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePlacementPolicy_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a placement policy by name in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePlacementPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwarePlacementPolicy_GetViaIdentity : global::System. /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwarePlacementPolicy_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwarePlacementPolicy_GetViaIdentity : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePlacementPolicy_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwarePlacementPolicy_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,7 +354,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -325,12 +377,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -347,7 +399,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -365,12 +417,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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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 ) { @@ -382,8 +434,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentityCluster.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentityCluster.cs new file mode 100644 index 000000000000..6da75f7a7795 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentityCluster.cs @@ -0,0 +1,474 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a placement policy by name in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePlacementPolicy_GetViaIdentityCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a placement policy by name in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwarePlacementPolicy_GetViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwarePlacementPolicy_GetViaIdentityCluster() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesGetViaIdentity(ClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.PlacementPoliciesGet(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..5bcd0af9d9c3 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,484 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a placement policy by name in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePlacementPolicy_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a placement policy by name in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwarePlacementPolicy_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwarePlacementPolicy_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.PlacementPoliciesGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_List.cs index 755d1de06bf3..43b010eb27f0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePlacementPolicy_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List placement policies in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePlacementPolicy_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List placement policies in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePlacementPolicy_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,17 +37,32 @@ public partial class GetAzVMwarePlacementPolicy_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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,14 +81,18 @@ public partial class GetAzVMwarePlacementPolicy_List : global::System.Management public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -96,7 +119,7 @@ public partial class GetAzVMwarePlacementPolicy_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -156,7 +179,8 @@ public partial class GetAzVMwarePlacementPolicy_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -165,24 +189,24 @@ public partial class GetAzVMwarePlacementPolicy_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPoliciesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList /// 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) @@ -205,11 +229,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePlacementPolicy_List() { @@ -260,8 +288,33 @@ public GetAzVMwarePlacementPolicy_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +367,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +388,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -358,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -380,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName }) + 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 } }); @@ -398,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.VMware.Models.Api20211201.IPlacementPoliciesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList /// 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 ) { @@ -415,15 +468,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPoliciesList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloudAdminCredential_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloudAdminCredential_List.cs index d703df4c12f2..d9f0662f4524 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloudAdminCredential_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloudAdminCredential_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List the admin credentials for the private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] ListAdminCredentials=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePrivateCloudAdminCredential_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List the admin credentials for the private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePrivateCloudAdminCredential_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwarePrivateCloudAdminCredential_List : global::Syste /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -76,7 +99,7 @@ public partial class GetAzVMwarePrivateCloudAdminCredential_List : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -136,7 +159,8 @@ public partial class GetAzVMwarePrivateCloudAdminCredential_List : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -145,24 +169,24 @@ public partial class GetAzVMwarePrivateCloudAdminCredential_List : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAdminCredentials + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials /// 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) @@ -185,11 +209,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePrivateCloudAdminCredential_List() { @@ -240,8 +268,33 @@ public GetAzVMwarePrivateCloudAdminCredential_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -297,7 +350,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +371,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -341,12 +394,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -363,15 +416,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -381,12 +434,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.VMware.Models.Api20211201.IAdminCredentials + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials /// 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 ) { @@ -398,8 +451,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAdminCredentials - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_Get.cs index 15899869d6fd..1470af26aa35 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePrivateCloud_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePrivateCloud_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwarePrivateCloud_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -91,7 +114,7 @@ public partial class GetAzVMwarePrivateCloud_Get : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -137,7 +160,8 @@ public partial class GetAzVMwarePrivateCloud_Get : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -146,24 +170,24 @@ public partial class GetAzVMwarePrivateCloud_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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) @@ -186,11 +210,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePrivateCloud_Get() { @@ -241,8 +269,33 @@ public GetAzVMwarePrivateCloud_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -295,7 +348,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -316,7 +369,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -339,12 +392,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -361,15 +414,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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 } }); @@ -379,12 +432,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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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 ) { @@ -396,8 +449,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_GetViaIdentity.cs index 54f769bbff83..f7875be0d44c 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePrivateCloud_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePrivateCloud_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwarePrivateCloud_GetViaIdentity : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwarePrivateCloud_GetViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwarePrivateCloud_GetViaIdentity : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePrivateCloud_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwarePrivateCloud_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -294,7 +346,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -317,12 +369,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -339,7 +391,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -357,12 +409,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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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 ) { @@ -374,8 +426,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List.cs index 96ab626b0c78..220aa73f37c0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List private clouds in a resource group @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePrivateCloud_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List private clouds in a resource group")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePrivateCloud_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,29 +37,48 @@ public partial class GetAzVMwarePrivateCloud_List : global::System.Management.Au /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -82,7 +105,7 @@ public partial class GetAzVMwarePrivateCloud_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,7 +151,8 @@ public partial class GetAzVMwarePrivateCloud_List : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -137,24 +161,24 @@ public partial class GetAzVMwarePrivateCloud_List : global::System.Management.Au /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList /// 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) @@ -177,11 +201,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePrivateCloud_List() { @@ -232,8 +260,33 @@ public GetAzVMwarePrivateCloud_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -286,7 +339,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -307,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -330,12 +383,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -352,15 +405,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName }) + 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 } }); @@ -370,12 +423,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.VMware.Models.Api20211201.IPrivateCloudList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList /// 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 ) { @@ -387,15 +440,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List1.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List1.cs index e9bf9495c08e..e9f16bec8625 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List1.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwarePrivateCloud_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List private clouds in a subscription @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] ListInSubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwarePrivateCloud_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List private clouds in a subscription")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/privateClouds", ApiVersion = "2023-03-01")] public partial class GetAzVMwarePrivateCloud_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,29 +37,48 @@ public partial class GetAzVMwarePrivateCloud_List1 : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -82,7 +105,7 @@ public partial class GetAzVMwarePrivateCloud_List1 : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -114,7 +137,8 @@ public partial class GetAzVMwarePrivateCloud_List1 : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -123,24 +147,24 @@ public partial class GetAzVMwarePrivateCloud_List1 : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloudList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList /// 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,11 +187,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwarePrivateCloud_List1() { @@ -218,8 +246,33 @@ public GetAzVMwarePrivateCloud_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -272,7 +325,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -293,7 +346,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -316,12 +369,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -338,15 +391,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId }) + 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 } }); @@ -356,12 +409,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.VMware.Models.Api20211201.IPrivateCloudList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList /// 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 ) { @@ -373,15 +426,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_Get.cs index 21bb2070ae83..c47d3294c50f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// @@ -16,11 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptCmdlet_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return information about a script cmdlet resource in a specific package on a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptCmdlet_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,23 +40,42 @@ public partial class GetAzVMwareScriptCmdlet_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -94,7 +117,7 @@ public partial class GetAzVMwareScriptCmdlet_Get : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -168,7 +191,8 @@ public partial class GetAzVMwareScriptCmdlet_Get : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -177,24 +201,24 @@ public partial class GetAzVMwareScriptCmdlet_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdlet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet /// 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) @@ -217,11 +241,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptCmdlet_Get() { @@ -272,8 +300,33 @@ public GetAzVMwareScriptCmdlet_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -326,7 +379,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -347,7 +400,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ScriptPackageName=ScriptPackageName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ScriptPackageName=ScriptPackageName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -370,12 +423,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -392,15 +445,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ScriptPackageName=ScriptPackageName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ScriptPackageName=ScriptPackageName, Name=Name }) + 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 } }); @@ -410,12 +463,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.VMware.Models.Api20211201.IScriptCmdlet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet /// 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 ) { @@ -427,8 +480,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentity.cs index cb42fbf7215a..fa36742ce761 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// @@ -16,11 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptCmdlet_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return information about a script cmdlet resource in a specific package on a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptCmdlet_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,23 +40,42 @@ public partial class GetAzVMwareScriptCmdlet_GetViaIdentity : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -87,7 +110,7 @@ public partial class GetAzVMwareScriptCmdlet_GetViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -110,24 +133,24 @@ public partial class GetAzVMwareScriptCmdlet_GetViaIdentity : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdlet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet /// 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) @@ -150,11 +173,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptCmdlet_GetViaIdentity() { @@ -205,8 +232,33 @@ public GetAzVMwareScriptCmdlet_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -259,7 +311,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -305,7 +357,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -328,12 +380,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -350,7 +402,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -368,12 +420,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.VMware.Models.Api20211201.IScriptCmdlet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet /// 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 ) { @@ -385,8 +437,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..7fb8661b8808 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,485 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// + /// Return information about a script cmdlet resource in a specific package on a private cloud + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptCmdlet_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return information about a script cmdlet resource in a specific package on a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareScriptCmdlet_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the script cmdlet resource in the script package in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the script cmdlet resource in the script package in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the script cmdlet resource in the script package in the private cloud", + SerializedName = @"scriptCmdletName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ScriptCmdletName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scriptPackageName; + + /// Name of the script package in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the script package in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the script package in the private cloud", + SerializedName = @"scriptPackageName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ScriptPackageName { get => this._scriptPackageName; set => this._scriptPackageName = 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.VMware.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.VMware.Models.IScriptCmdlet + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareScriptCmdlet_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/scriptPackages/{(global::System.Uri.EscapeDataString(this.ScriptPackageName.ToString()))}/scriptCmdlets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ScriptCmdletsGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ScriptCmdletsGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ScriptPackageName, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ScriptPackageName=ScriptPackageName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptCmdlet + /// 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.VMware.Models.IScriptCmdlet + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentityScriptPackage.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentityScriptPackage.cs new file mode 100644 index 000000000000..7ad31234e858 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_GetViaIdentityScriptPackage.cs @@ -0,0 +1,475 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// + /// Return information about a script cmdlet resource in a specific package on a private cloud + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptCmdlet_GetViaIdentityScriptPackage")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return information about a script cmdlet resource in a specific package on a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets/{scriptCmdletName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareScriptCmdlet_GetViaIdentityScriptPackage : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the script cmdlet resource in the script package in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the script cmdlet resource in the script package in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the script cmdlet resource in the script package in the private cloud", + SerializedName = @"scriptCmdletName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ScriptCmdletName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _scriptPackageInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ScriptPackageInputObject { get => this._scriptPackageInputObject; set => this._scriptPackageInputObject = 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.VMware.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.VMware.Models.IScriptCmdlet + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareScriptCmdlet_GetViaIdentityScriptPackage() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ScriptPackageInputObject?.Id != null) + { + this.ScriptPackageInputObject.Id += $"/scriptCmdlets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ScriptCmdletsGetViaIdentity(ScriptPackageInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ScriptPackageInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ScriptPackageInputObject has null value for ScriptPackageInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ScriptPackageInputObject) ); + } + if (null == ScriptPackageInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ScriptPackageInputObject has null value for ScriptPackageInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ScriptPackageInputObject) ); + } + if (null == ScriptPackageInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ScriptPackageInputObject has null value for ScriptPackageInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ScriptPackageInputObject) ); + } + if (null == ScriptPackageInputObject.ScriptPackageName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ScriptPackageInputObject has null value for ScriptPackageInputObject.ScriptPackageName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ScriptPackageInputObject) ); + } + await this.Client.ScriptCmdletsGet(ScriptPackageInputObject.SubscriptionId ?? null, ScriptPackageInputObject.ResourceGroupName ?? null, ScriptPackageInputObject.PrivateCloudName ?? null, ScriptPackageInputObject.ScriptPackageName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptCmdlet + /// 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.VMware.Models.IScriptCmdlet + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_List.cs index 0957ebf75e0e..488ed732a3db 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptCmdlet_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// @@ -16,11 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptCmdlet_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List script cmdlet resources available for a private cloud to create a script execution resource on a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}/scriptCmdlets", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptCmdlet_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,29 +40,48 @@ public partial class GetAzVMwareScriptCmdlet_List : global::System.Management.Au /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareScriptCmdlet_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -159,7 +182,8 @@ public partial class GetAzVMwareScriptCmdlet_List : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,24 +192,24 @@ public partial class GetAzVMwareScriptCmdlet_List : global::System.Management.Au /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptCmdletsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList /// 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) @@ -208,11 +232,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptCmdlet_List() { @@ -263,8 +291,33 @@ public GetAzVMwareScriptCmdlet_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -317,7 +370,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -338,7 +391,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ScriptPackageName=ScriptPackageName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ScriptPackageName=ScriptPackageName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -361,12 +414,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -383,15 +436,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ScriptPackageName=ScriptPackageName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ScriptPackageName=ScriptPackageName }) + 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 } }); @@ -401,12 +454,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.VMware.Models.Api20211201.IScriptCmdletsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList /// 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 ) { @@ -418,15 +471,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdletsList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_Get.cs index 8e82d84075aa..9b54a76f72d6 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Return the logs for a script execution resource @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecutionLog_Get", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return the logs for a script execution resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Manageme /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -77,7 +100,7 @@ public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -138,7 +161,7 @@ public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Manageme public string ScriptExecutionName { get => this._scriptExecutionName; set => this._scriptExecutionName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] _scriptOutputStreamType; + private System.Collections.Generic.List _scriptOutputStreamType; /// Array of ScriptOutputStreamType [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Array of ScriptOutputStreamType", ValueFromPipeline = true)] @@ -148,9 +171,9 @@ public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Manageme ReadOnly = false, Description = @"Array of ScriptOutputStreamType", SerializedName = @"scriptOutputStreamType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] ScriptOutputStreamType { get => this._scriptOutputStreamType; set => this._scriptOutputStreamType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + public System.Collections.Generic.List ScriptOutputStreamType { get => this._scriptOutputStreamType; set => this._scriptOutputStreamType = value; } /// Backing field for property. private string[] _subscriptionId; @@ -166,7 +189,8 @@ public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -175,24 +199,24 @@ public partial class GetAzVMwareScriptExecutionLog_Get : global::System.Manageme /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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) @@ -215,11 +239,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptExecutionLog_Get() { @@ -270,8 +298,33 @@ public GetAzVMwareScriptExecutionLog_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -327,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -348,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ScriptExecutionName=ScriptExecutionName,body=ScriptOutputStreamType}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ScriptExecutionName=ScriptExecutionName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -371,12 +424,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -393,15 +446,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ScriptExecutionName=ScriptExecutionName, body=ScriptOutputStreamType }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ScriptExecutionName=ScriptExecutionName, body=ScriptOutputStreamType }) + 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 } }); @@ -411,12 +464,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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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 ) { @@ -428,8 +481,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentity.cs index 5eff72b5c681..bbc9a8db7e52 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Return the logs for a script execution resource @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecutionLog_GetViaIdentity", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return the logs for a script execution resource")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptExecutionLog_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareScriptExecutionLog_GetViaIdentity : global::Syst /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareScriptExecutionLog_GetViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -104,7 +127,7 @@ public partial class GetAzVMwareScriptExecutionLog_GetViaIdentity : global::Syst public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] _scriptOutputStreamType; + private System.Collections.Generic.List _scriptOutputStreamType; /// Array of ScriptOutputStreamType [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Array of ScriptOutputStreamType", ValueFromPipeline = true)] @@ -114,33 +137,33 @@ public partial class GetAzVMwareScriptExecutionLog_GetViaIdentity : global::Syst ReadOnly = false, Description = @"Array of ScriptOutputStreamType", SerializedName = @"scriptOutputStreamType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] ScriptOutputStreamType { get => this._scriptOutputStreamType; set => this._scriptOutputStreamType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + public System.Collections.Generic.List ScriptOutputStreamType { get => this._scriptOutputStreamType; set => this._scriptOutputStreamType = 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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,11 +186,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptExecutionLog_GetViaIdentity() { @@ -218,8 +245,33 @@ public GetAzVMwareScriptExecutionLog_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +327,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +369,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ScriptOutputStreamType}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -340,12 +392,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +414,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ScriptOutputStreamType }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=ScriptOutputStreamType }) + 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 +432,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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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,8 +449,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..0ac4a2eee3cc --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,486 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Return the logs for a script execution resource + /// + /// [OpenAPI] GetExecutionLogs=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return the logs for a script execution resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}/getExecutionLogs", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _scriptExecutionName; + + /// Name of the user-invoked script execution resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the user-invoked script execution resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the user-invoked script execution resource", + SerializedName = @"scriptExecutionName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ScriptExecutionName { get => this._scriptExecutionName; set => this._scriptExecutionName = value; } + + /// Backing field for property. + private System.Collections.Generic.List _scriptOutputStreamType; + + /// Array of ScriptOutputStreamType + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Array of ScriptOutputStreamType", ValueFromPipeline = true)] + [global::System.Management.Automation.AllowEmptyCollection] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Array of ScriptOutputStreamType", + SerializedName = @"scriptOutputStreamType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + public System.Collections.Generic.List ScriptOutputStreamType { get => this._scriptOutputStreamType; set => this._scriptOutputStreamType = 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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScriptExecutionsGetExecutionLogs' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/scriptExecutions/{(global::System.Uri.EscapeDataString(this.ScriptExecutionName.ToString()))}"; + await this.Client.ScriptExecutionsGetExecutionLogsViaIdentity(PrivateCloudInputObject.Id, ScriptOutputStreamType, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ScriptExecutionsGetExecutionLogs(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ScriptExecutionName, ScriptOutputStreamType, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ScriptExecutionName=ScriptExecutionName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_Get.cs index 911ae5d480e6..7594b30f9bcb 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an script execution by name in a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecution_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an script execution by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptExecution_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareScriptExecution_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -92,7 +115,7 @@ public partial class GetAzVMwareScriptExecution_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -152,7 +175,8 @@ public partial class GetAzVMwareScriptExecution_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +185,24 @@ public partial class GetAzVMwareScriptExecution_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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) @@ -201,11 +225,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptExecution_Get() { @@ -256,8 +284,33 @@ public GetAzVMwareScriptExecution_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -310,7 +363,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -331,7 +384,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +407,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -376,15 +429,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -394,12 +447,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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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 ) { @@ -411,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentity.cs index 83992030f4d7..ad1f1453affe 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get an script execution by name in a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecution_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an script execution by name in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptExecution_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareScriptExecution_GetViaIdentity : global::System. /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareScriptExecution_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareScriptExecution_GetViaIdentity : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptExecution_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareScriptExecution_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..0a95c834b733 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,469 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get an script execution by name in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecution_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get an script execution by name in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareScriptExecution_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the user-invoked script execution resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the user-invoked script execution resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the user-invoked script execution resource", + SerializedName = @"scriptExecutionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ScriptExecutionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareScriptExecution_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/scriptExecutions/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ScriptExecutionsGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ScriptExecutionsGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_List.cs index e316334cfc00..3e0d09f2d7c1 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptExecution_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List script executions in a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptExecution_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List script executions in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptExecution_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareScriptExecution_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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareScriptExecution_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareScriptExecution_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareScriptExecution_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecutionsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptExecution_List() { @@ -247,8 +275,33 @@ public GetAzVMwareScriptExecution_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IScriptExecutionsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionsList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_Get.cs index 8e504f142ad7..28b9a904cb8e 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a script package available to run on a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptPackage_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a script package available to run on a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptPackage_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareScriptPackage_Get : global::System.Management.Au /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -92,7 +115,7 @@ public partial class GetAzVMwareScriptPackage_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -152,7 +175,8 @@ public partial class GetAzVMwareScriptPackage_Get : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -161,24 +185,24 @@ public partial class GetAzVMwareScriptPackage_Get : global::System.Management.Au /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage /// 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) @@ -201,11 +225,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptPackage_Get() { @@ -256,8 +284,33 @@ public GetAzVMwareScriptPackage_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -310,7 +363,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -331,7 +384,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -354,12 +407,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -376,15 +429,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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 } }); @@ -394,12 +447,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.VMware.Models.Api20211201.IScriptPackage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage /// 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 ) { @@ -411,8 +464,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentity.cs index acbb8988ef8d..d14d6e6fa15f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a script package available to run on a private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptPackage_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a script package available to run on a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptPackage_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareScriptPackage_GetViaIdentity : global::System.Ma /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareScriptPackage_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareScriptPackage_GetViaIdentity : global::System.Ma /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptPackage_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareScriptPackage_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IScriptPackage + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..dc886a4e74ee --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,469 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a script package available to run on a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptPackage_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a script package available to run on a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages/{scriptPackageName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareScriptPackage_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the script package in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the script package in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the script package in the private cloud", + SerializedName = @"scriptPackageName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ScriptPackageName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IScriptPackage + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareScriptPackage_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/scriptPackages/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ScriptPackagesGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ScriptPackagesGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptPackage + /// 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.VMware.Models.IScriptPackage + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_List.cs index 452e38732c87..aa0af28186a6 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareScriptPackage_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List script packages available to run on the private cloud @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareScriptPackage_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List script packages available to run on the private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptPackages", ApiVersion = "2023-03-01")] public partial class GetAzVMwareScriptPackage_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareScriptPackage_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareScriptPackage_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareScriptPackage_List : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareScriptPackage_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptPackagesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareScriptPackage_List() { @@ -247,8 +275,33 @@ public GetAzVMwareScriptPackage_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IScriptPackagesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackagesList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_Get.cs index 20346e4117b5..e931152f6529 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a virtual machine by id in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareVirtualMachine_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareVirtualMachine_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,11 +37,26 @@ public partial class GetAzVMwareVirtualMachine_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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -56,14 +75,18 @@ public partial class GetAzVMwareVirtualMachine_Get : global::System.Management.A public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class GetAzVMwareVirtualMachine_Get : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -165,7 +188,8 @@ public partial class GetAzVMwareVirtualMachine_Get : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -174,24 +198,24 @@ public partial class GetAzVMwareVirtualMachine_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine /// 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) @@ -214,11 +238,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareVirtualMachine_Get() { @@ -269,8 +297,33 @@ public GetAzVMwareVirtualMachine_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -323,7 +376,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -344,7 +397,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Id=Id}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Id=Id}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -367,12 +420,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -389,15 +442,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Id=Id }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Id=Id }) + 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 } }); @@ -407,12 +460,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.VMware.Models.Api20211201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine /// 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 ) { @@ -424,8 +477,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentity.cs index 6e686395aa16..ea60977bb098 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a virtual machine by id in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareVirtualMachine_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareVirtualMachine_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class GetAzVMwareVirtualMachine_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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -84,7 +107,7 @@ public partial class GetAzVMwareVirtualMachine_GetViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -107,24 +130,24 @@ public partial class GetAzVMwareVirtualMachine_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine /// 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) @@ -147,11 +170,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareVirtualMachine_GetViaIdentity() { @@ -202,8 +229,33 @@ public GetAzVMwareVirtualMachine_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -256,7 +308,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,7 +354,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -325,12 +377,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -347,7 +399,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -365,12 +417,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.VMware.Models.Api20211201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine /// 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 ) { @@ -382,8 +434,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentityCluster.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentityCluster.cs new file mode 100644 index 000000000000..fa66f203d39d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentityCluster.cs @@ -0,0 +1,472 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a virtual machine by id in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareVirtualMachine_GetViaIdentityCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareVirtualMachine_GetViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// Virtual Machine identifier + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Virtual Machine identifier")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Virtual Machine identifier", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IVirtualMachine + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareVirtualMachine_GetViaIdentityCluster() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/virtualMachines/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.VirtualMachinesGetViaIdentity(ClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.VirtualMachinesGet(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Id, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IVirtualMachine + /// 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.VMware.Models.IVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..1a7e54f9db57 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,482 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a virtual machine by id in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareVirtualMachine_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareVirtualMachine_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// Virtual Machine identifier + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Virtual Machine identifier")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Virtual Machine identifier", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IVirtualMachine + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareVirtualMachine_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/virtualMachines/{(global::System.Uri.EscapeDataString(this.Id.ToString()))}"; + await this.Client.VirtualMachinesGetViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.VirtualMachinesGet(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Id, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IVirtualMachine + /// 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.VMware.Models.IVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_List.cs index dd2b2c959026..ba2aaaaade70 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareVirtualMachine_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of virtual machines in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareVirtualMachine_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of virtual machines in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines", ApiVersion = "2023-03-01")] public partial class GetAzVMwareVirtualMachine_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,17 +37,32 @@ public partial class GetAzVMwareVirtualMachine_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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,14 +81,18 @@ public partial class GetAzVMwareVirtualMachine_List : global::System.Management. public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -96,7 +119,7 @@ public partial class GetAzVMwareVirtualMachine_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -156,7 +179,8 @@ public partial class GetAzVMwareVirtualMachine_List : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -165,24 +189,24 @@ public partial class GetAzVMwareVirtualMachine_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IVirtualMachinesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList /// 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) @@ -205,11 +229,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareVirtualMachine_List() { @@ -260,8 +288,33 @@ public GetAzVMwareVirtualMachine_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +367,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +388,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -358,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -380,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName }) + 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 } }); @@ -398,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.VMware.Models.Api20211201.IVirtualMachinesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList /// 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 ) { @@ -415,15 +468,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachinesList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_Get.cs index b0b91562eb44..e543f6b203b1 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get dhcp by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDhcp_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDhcp_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,18 +38,34 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -65,6 +85,9 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_Get : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DhcpName { get => this._dhcpName; set => this._dhcpName = 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] @@ -91,7 +114,7 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_Get : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_Get : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDhcp_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareWorkloadNetworkDhcp_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,DhcpName=DhcpName,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DhcpName=DhcpName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DhcpName=DhcpName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DhcpName=DhcpName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity.cs index f3a842c1f33f..51dd1c50e880 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get dhcp by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDhcp_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity : global::Sys /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity : global::Sys /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDhcp_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkDhcp_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration.cs new file mode 100644 index 000000000000..69e29e2bc0e1 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration.cs @@ -0,0 +1,469 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get dhcp by id in a private cloud workload network. + /// + /// [OpenAPI] GetDhcp=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get dhcp by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _dhcpConfigurationInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity DhcpConfigurationInputObject { get => this._dhcpConfigurationInputObject; set => this._dhcpConfigurationInputObject = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (DhcpConfigurationInputObject?.Id != null) + { + this.DhcpConfigurationInputObject.Id += $"/privateClouds/{(global::System.Uri.EscapeDataString(this.PrivateCloudName.ToString()))}"; + await this.Client.WorkloadNetworksGetDhcpViaIdentity(DhcpConfigurationInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == DhcpConfigurationInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DhcpConfigurationInputObject has null value for DhcpConfigurationInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DhcpConfigurationInputObject) ); + } + if (null == DhcpConfigurationInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DhcpConfigurationInputObject has null value for DhcpConfigurationInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DhcpConfigurationInputObject) ); + } + if (null == DhcpConfigurationInputObject.DhcpId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DhcpConfigurationInputObject has null value for DhcpConfigurationInputObject.DhcpId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DhcpConfigurationInputObject) ); + } + await this.Client.WorkloadNetworksGetDhcp(DhcpConfigurationInputObject.SubscriptionId ?? null, DhcpConfigurationInputObject.ResourceGroupName ?? null, DhcpConfigurationInputObject.DhcpId ?? null, PrivateCloudName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_List.cs index a55a16284a06..004fbcdd3202 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDhcp_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List dhcp in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDhcp_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List dhcp in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDhcp_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_List : global::System.Manage /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_List : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_List : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkDhcp_List : global::System.Manage /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcpList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDhcp_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkDhcp_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkDhcpList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcpList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_Get.cs index d7bcbe769d5e..d9501f6594d3 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a DNS service by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsService_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDnsService_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,18 +38,34 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -67,6 +87,9 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_Get : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = 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] @@ -93,7 +116,7 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_Get : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -153,7 +176,8 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_Get : global::System.M [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +186,24 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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) @@ -202,11 +226,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDnsService_Get() { @@ -257,8 +285,33 @@ public GetAzVMwareWorkloadNetworkDnsService_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -311,7 +364,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -332,7 +385,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DnsServiceName=DnsServiceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DnsServiceName=DnsServiceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +408,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +430,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsServiceName=DnsServiceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsServiceName=DnsServiceName }) + 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 +448,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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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 +465,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity.cs index ee110bdf718c..63298d7cf6c4 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a DNS service by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsService_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity : globa /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDnsService_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkDnsService_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..1d282fa57e27 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,471 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a DNS service by id in a private cloud workload network. + /// + /// [OpenAPI] GetDnsService=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a DNS service by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _dnsServiceName; + + /// + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DNS Service identifier. Generally the same as the DNS Service's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DNS Service identifier. Generally the same as the DNS Service's display name", + SerializedName = @"dnsServiceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dnsServices/{(global::System.Uri.EscapeDataString(this.DnsServiceName.ToString()))}"; + await this.Client.WorkloadNetworksGetDnsServiceViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetDnsService(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DnsServiceName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DnsServiceName=DnsServiceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_List.cs index a869d12b7f5e..97639f4147b2 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsService_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of DNS services in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsService_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of DNS services in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDnsService_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_List : global::System. /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_List : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_List : global::System. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkDnsService_List : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDnsService_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkDnsService_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkDnsServicesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsServicesList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_Get.cs index a18c072c0168..ca68b372d1db 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a DNS zone by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsZone_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDnsZone_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,18 +38,34 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_Get : global::System.Mana /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -65,6 +85,9 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_Get : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DnsZoneName { get => this._dnsZoneName; set => this._dnsZoneName = 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] @@ -91,7 +114,7 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_Get : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_Get : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_Get : global::System.Mana /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDnsZone_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareWorkloadNetworkDnsZone_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DnsZoneName=DnsZoneName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DnsZoneName=DnsZoneName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsZoneName=DnsZoneName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsZoneName=DnsZoneName }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity.cs index 1682460254e4..d51c70abc452 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a DNS zone by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsZone_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity : global:: /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkDnsZone_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..f7cdd248f49d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a DNS zone by id in a private cloud workload network. + /// + /// [OpenAPI] GetDnsZone=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a DNS zone by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _dnsZoneName; + + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DNS Zone identifier. Generally the same as the DNS Zone's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DNS Zone identifier. Generally the same as the DNS Zone's display name", + SerializedName = @"dnsZoneId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DnsZoneName { get => this._dnsZoneName; set => this._dnsZoneName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dnsZones/{(global::System.Uri.EscapeDataString(this.DnsZoneName.ToString()))}"; + await this.Client.WorkloadNetworksGetDnsZoneViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetDnsZone(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DnsZoneName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DnsZoneName=DnsZoneName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_List.cs index 683d0ad34c7c..dc8013fee849 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkDnsZone_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of DNS zones in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkDnsZone_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of DNS zones in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkDnsZone_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkDnsZone_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkDnsZone_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkDnsZone_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkDnsZonesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZonesList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_Get.cs index dee52f582e10..bf5f7ec530ea 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a gateway by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkGateway_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a gateway by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkGateway_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkGateway_Get : global::System.Mana /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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 _gatewayName; @@ -91,7 +114,7 @@ public partial class GetAzVMwareWorkloadNetworkGateway_Get : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareWorkloadNetworkGateway_Get : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareWorkloadNetworkGateway_Get : global::System.Mana /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkGateway + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkGateway_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareWorkloadNetworkGateway_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,GatewayName=GatewayName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,GatewayName=GatewayName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, GatewayName=GatewayName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, GatewayName=GatewayName }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IWorkloadNetworkGateway + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentity.cs index 00f060439156..c4af5e7bb15e 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a gateway by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkGateway_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a gateway by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkGateway_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkGateway_GetViaIdentity : global:: /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkGateway_GetViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkGateway_GetViaIdentity : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkGateway + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkGateway_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkGateway_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkGateway + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..14a55badca10 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a gateway by id in a private cloud workload network. + /// + /// [OpenAPI] GetGateway=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a gateway by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways/{gatewayId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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 _gatewayName; + + /// NSX Gateway identifier. Generally the same as the Gateway's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Gateway identifier. Generally the same as the Gateway's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Gateway identifier. Generally the same as the Gateway's display name", + SerializedName = @"gatewayId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string GatewayName { get => this._gatewayName; set => this._gatewayName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetworkGateway + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/gateways/{(global::System.Uri.EscapeDataString(this.GatewayName.ToString()))}"; + await this.Client.WorkloadNetworksGetGatewayViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetGateway(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, GatewayName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GatewayName=GatewayName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkGateway + /// 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.VMware.Models.IWorkloadNetworkGateway + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_List.cs index 70be77fedd3e..d3b2457e4b99 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkGateway_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of gateways in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkGateway_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of gateways in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/gateways", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkGateway_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkGateway_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkGateway_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkGateway_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkGateway_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkGatewayList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkGateway_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkGateway_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkGatewayList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGatewayList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_Get.cs index 2c31c7b89375..fe8cc730b9a5 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a port mirroring profile by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPortMirroring_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkPortMirroring_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_Get : global::Syste /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -77,7 +100,7 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_Get : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _portMirroringName; @@ -153,7 +176,8 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_Get : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +186,24 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_Get : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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) @@ -202,11 +226,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkPortMirroring_Get() { @@ -257,8 +285,33 @@ public GetAzVMwareWorkloadNetworkPortMirroring_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -311,7 +364,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -332,7 +385,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,PortMirroringName=PortMirroringName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,PortMirroringName=PortMirroringName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +408,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +430,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PortMirroringName=PortMirroringName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PortMirroringName=PortMirroringName }) + 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 +448,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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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 +465,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity.cs index a67d1c5dfeda..7c43a05a245c 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a port mirroring profile by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPortMirroring_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity : gl /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity : gl /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkPortMirroring_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..4300cef6b734 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,471 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a port mirroring profile by id in a private cloud workload network. + /// + /// [OpenAPI] GetPortMirroring=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a port mirroring profile by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _portMirroringName; + + /// + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name", + SerializedName = @"portMirroringId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PortMirroringName { get => this._portMirroringName; set => this._portMirroringName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/portMirroringProfiles/{(global::System.Uri.EscapeDataString(this.PortMirroringName.ToString()))}"; + await this.Client.WorkloadNetworksGetPortMirroringViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetPortMirroring(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, PortMirroringName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PortMirroringName=PortMirroringName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_List.cs index 98328810805e..0e89849930be 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPortMirroring_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of port mirroring profiles in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPortMirroring_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of port mirroring profiles in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkPortMirroring_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_List : global::Syst /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_List : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_List : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkPortMirroring_List : global::Syst /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkPortMirroring_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkPortMirroring_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroringList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroringList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_Get.cs index 26e203c764de..d14f0ea1ef32 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a Public IP Block by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPublicIP_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a Public IP Block by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkPublicIP_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -77,7 +100,7 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -153,7 +176,8 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_Get : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +186,24 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP /// 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) @@ -202,11 +226,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkPublicIP_Get() { @@ -257,8 +285,33 @@ public GetAzVMwareWorkloadNetworkPublicIP_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -311,7 +364,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -332,7 +385,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,PublicIPName=PublicIPName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,PublicIPName=PublicIPName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +408,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +430,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PublicIPName=PublicIPName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PublicIPName=PublicIPName }) + 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 +448,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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP /// 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 +465,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity.cs index 4fe5ada45aa6..7e76d825ade3 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a Public IP Block by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPublicIP_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a Public IP Block by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity : global: /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity : global: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkPublicIP_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..1db7a07c9e5e --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,471 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a Public IP Block by id in a private cloud workload network. + /// + /// [OpenAPI] GetPublicIP=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a Public IP Block by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _publicIPName; + + /// + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Public IP Block identifier. Generally the same as the Public IP Block's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Public IP Block identifier. Generally the same as the Public IP Block's display name", + SerializedName = @"publicIPId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PublicIPName { get => this._publicIPName; set => this._publicIPName = 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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public GetAzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/publicIPs/{(global::System.Uri.EscapeDataString(this.PublicIPName.ToString()))}"; + await this.Client.WorkloadNetworksGetPublicIPViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetPublicIP(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, PublicIPName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PublicIPName=PublicIPName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP + /// 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.VMware.Models.IWorkloadNetworkPublicIP + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_List.cs index 0b184f7be6eb..2fdd94be9a63 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkPublicIP_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of Public IP Blocks in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkPublicIP_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of Public IP Blocks in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkPublicIP_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_List : global::System.Ma /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkPublicIP_List : global::System.Ma /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkPublicIP_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkPublicIP_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkPublicIPsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIPsList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_Get.cs index 97611c4bb93a..f7cc2722f1a7 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a segment by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkSegment_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkSegment_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkSegment_Get : global::System.Mana /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -77,7 +100,7 @@ public partial class GetAzVMwareWorkloadNetworkSegment_Get : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -151,7 +174,8 @@ public partial class GetAzVMwareWorkloadNetworkSegment_Get : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareWorkloadNetworkSegment_Get : global::System.Mana /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkSegment_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareWorkloadNetworkSegment_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentity.cs index 32f3c52a6942..5539101676e0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a segment by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkSegment_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkSegment_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkSegment_GetViaIdentity : global:: /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkSegment_GetViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkSegment_GetViaIdentity : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkSegment_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkSegment_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..f4f6a797e3e5 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a segment by id in a private cloud workload network. + /// + /// [OpenAPI] GetSegment=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a segment by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _segmentName; + + /// NSX Segment identifier. Generally the same as the Segment's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Segment identifier. Generally the same as the Segment's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Segment identifier. Generally the same as the Segment's display name", + SerializedName = @"segmentId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string SegmentName { get => this._segmentName; set => this._segmentName = 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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/segments/{(global::System.Uri.EscapeDataString(this.SegmentName.ToString()))}"; + await this.Client.WorkloadNetworksGetSegmentViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetSegment(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, SegmentName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SegmentName=SegmentName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_List.cs index b94b8a3ddd55..eaf243c843e6 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkSegment_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of segments in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkSegment_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of segments in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkSegment_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkSegment_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkSegment_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkSegment_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkSegment_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkSegment_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkSegment_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkSegmentsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegmentsList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_Get.cs index e474ba789837..d4e826680981 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a vm group by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVMGroup_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkVMGroup_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_Get : global::System.Mana /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -77,7 +100,7 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_Get : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -137,7 +160,8 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_Get : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_Get : global::System.Mana /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkVMGroup_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareWorkloadNetworkVMGroup_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,VMGroupName=VMGroupName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,VMGroupName=VMGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VMGroupName=VMGroupName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VMGroupName=VMGroupName }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity.cs index 350c0f696712..d588ce0faa83 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a vm group by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVMGroup_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity : global:: /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkVMGroup_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..4b91f5a35127 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a vm group by id in a private cloud workload network. + /// + /// [OpenAPI] GetVMGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a vm group by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _vMGroupName; + + /// NSX VM Group identifier. Generally the same as the VM Group's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX VM Group identifier. Generally the same as the VM Group's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX VM Group identifier. Generally the same as the VM Group's display name", + SerializedName = @"vmGroupId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string VMGroupName { get => this._vMGroupName; set => this._vMGroupName = 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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/vmGroups/{(global::System.Uri.EscapeDataString(this.VMGroupName.ToString()))}"; + await this.Client.WorkloadNetworksGetVMGroupViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetVMGroup(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, VMGroupName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VMGroupName=VMGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_List.cs index 02e001418411..63165e322f70 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVMGroup_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of vm groups in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVMGroup_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of vm groups in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkVMGroup_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_List : 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 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkVMGroup_List : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkVMGroup_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkVMGroup_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkVMGroupsList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroupsList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_Get.cs index 661f8a36af21..1ca514ca8463 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_Get.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a virtual machine by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVM_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkVM_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkVM_Get : 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -77,7 +100,7 @@ public partial class GetAzVMwareWorkloadNetworkVM_Get : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -137,7 +160,8 @@ public partial class GetAzVMwareWorkloadNetworkVM_Get : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -160,24 +184,24 @@ public partial class GetAzVMwareWorkloadNetworkVM_Get : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine /// 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) @@ -200,11 +224,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkVM_Get() { @@ -255,8 +283,33 @@ public GetAzVMwareWorkloadNetworkVM_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -309,7 +362,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -330,7 +383,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,VirtualMachineId=VirtualMachineId}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,VirtualMachineId=VirtualMachineId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -353,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -375,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VirtualMachineId=VirtualMachineId }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VirtualMachineId=VirtualMachineId }) + 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 } }); @@ -393,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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine /// 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 ) { @@ -410,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentity.cs index d8a8cfe7f039..ab5ccc76918d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Get a virtual machine by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVM_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkVM_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,23 +38,42 @@ public partial class GetAzVMwareWorkloadNetworkVM_GetViaIdentity : global::Syste /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -85,7 +108,7 @@ public partial class GetAzVMwareWorkloadNetworkVM_GetViaIdentity : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -108,24 +131,24 @@ public partial class GetAzVMwareWorkloadNetworkVM_GetViaIdentity : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine /// 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) @@ -148,11 +171,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkVM_GetViaIdentity() { @@ -203,8 +230,33 @@ public GetAzVMwareWorkloadNetworkVM_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -257,7 +309,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -299,7 +351,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -322,12 +374,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -344,7 +396,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } @@ -362,12 +414,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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine /// 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 ) { @@ -379,8 +431,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..415baf536971 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud.cs @@ -0,0 +1,468 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a virtual machine by id in a private cloud workload network. + /// + /// [OpenAPI] GetVirtualMachine=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a virtual machine by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines/{virtualMachineId}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _virtualMachineId; + + /// Virtual Machine identifier + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Virtual Machine identifier")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Virtual Machine identifier", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = 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.VMware.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.VMware.Models.IWorkloadNetworkVirtualMachine + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/virtualMachines/{(global::System.Uri.EscapeDataString(this.VirtualMachineId.ToString()))}"; + await this.Client.WorkloadNetworksGetVirtualMachineViaIdentity(PrivateCloudInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksGetVirtualMachine(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, VirtualMachineId, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VirtualMachineId=VirtualMachineId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkVirtualMachine + /// 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.VMware.Models.IWorkloadNetworkVirtualMachine + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_List.cs index 23be103d518b..6ac1184dd43f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_List.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetworkVM_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// List of virtual machines in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetworkVM_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of virtual machines in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/virtualMachines", ApiVersion = "2023-03-01")] public partial class GetAzVMwareWorkloadNetworkVM_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,29 +38,48 @@ public partial class GetAzVMwareWorkloadNetworkVM_List : global::System.Manageme /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -83,7 +106,7 @@ public partial class GetAzVMwareWorkloadNetworkVM_List : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -143,7 +166,8 @@ public partial class GetAzVMwareWorkloadNetworkVM_List : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -152,24 +176,24 @@ public partial class GetAzVMwareWorkloadNetworkVM_List : global::System.Manageme /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList /// 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) @@ -192,11 +216,15 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzVMwareWorkloadNetworkVM_List() { @@ -247,8 +275,33 @@ public GetAzVMwareWorkloadNetworkVM_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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +354,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +375,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -345,12 +398,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -367,15 +420,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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 } }); @@ -385,12 +438,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.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachinesList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList /// 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 ) { @@ -402,15 +455,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachinesList + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_Get.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_Get.cs new file mode 100644 index 000000000000..ea0880dca451 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_Get.cs @@ -0,0 +1,475 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a private cloud workload network. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetwork_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetwork_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.IWorkloadNetwork + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetwork_Get() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkloadNetworksGet(SubscriptionId, ResourceGroupName, PrivateCloudName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetwork + /// 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.VMware.Models.IWorkloadNetwork + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_GetViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_GetViaIdentity.cs new file mode 100644 index 000000000000..fffe24a9b640 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_GetViaIdentity.cs @@ -0,0 +1,453 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Get a private cloud workload network. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetwork_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Get a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/{workloadNetworkName}", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetwork_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetwork + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetwork_GetViaIdentity() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetwork + /// 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.VMware.Models.IWorkloadNetwork + 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/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_List.cs b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_List.cs new file mode 100644 index 000000000000..572c06574bb5 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/GetAzVMwareWorkloadNetwork_List.cs @@ -0,0 +1,502 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// List of workload networks in a private cloud. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzVMwareWorkloadNetwork_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"List of workload networks in a private cloud.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks", ApiVersion = "2023-03-01")] + public partial class GetAzVMwareWorkloadNetwork_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 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; + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkList + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public GetAzVMwareWorkloadNetwork_List() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkloadNetworksList(SubscriptionId, ResourceGroupName, PrivateCloudName, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkList + /// 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.VMware.Models.IWorkloadNetworkList + var result = (await response); + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + 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 (!String.IsNullOrEmpty(_nextLink)) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.WorkloadNetworksList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictExpanded.cs index da43b0e6e894..dc178f24be6f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Enable or disable DRS-driven VM movement restriction @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Enable or disable DRS-driven VM movement restriction")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement", ApiVersion = "2023-03-01")] public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa /// 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; + /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement _restrictMovementBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineRestrictMovement(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement _restrictMovementBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineRestrictMovement(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -65,14 +84,18 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +130,7 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -161,9 +184,9 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa ReadOnly = false, Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", SerializedName = @"restrictMovement", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState RestrictMovement { get => _restrictMovementBody.RestrictMovement ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState)""); set => _restrictMovementBody.RestrictMovement = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string RestrictMovement { get => _restrictMovementBody.RestrictMovement ?? null; set => _restrictMovementBody.RestrictMovement = value; } /// Backing field for property. private string _subscriptionId; @@ -179,7 +202,8 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +226,12 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictExpanded : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -256,11 +280,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.LockAzVMwareVirtualMach /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public LockAzVMwareVirtualMachineMovement_RestrictExpanded() { @@ -311,11 +339,36 @@ public LockAzVMwareVirtualMachineMovement_RestrictExpanded() 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -327,10 +380,26 @@ public LockAzVMwareVirtualMachineMovement_RestrictExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -398,7 +467,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -416,7 +485,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,VirtualMachineId=VirtualMachineId,body=_restrictMovementBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,VirtualMachineId=VirtualMachineId}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -439,12 +508,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -461,15 +530,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, VirtualMachineId=VirtualMachineId, body=_restrictMovementBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, VirtualMachineId=VirtualMachineId, body=_restrictMovementBody }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..395958dff3d8 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded.cs @@ -0,0 +1,520 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Enable or disable DRS-driven VM movement restriction + /// + /// [OpenAPI] RestrictMovement=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Lock, @"AzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Enable or disable DRS-driven VM movement restriction")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement", ApiVersion = "2023-03-01")] + public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement _restrictMovementBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineRestrictMovement(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether VM DRS-driven movement is restricted (enabled) or not (disabled)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", + SerializedName = @"restrictMovement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string RestrictMovement { get => _restrictMovementBody.RestrictMovement ?? null; set => _restrictMovementBody.RestrictMovement = value; } + + /// Backing field for property. + private string _virtualMachineId; + + /// Virtual Machine identifier + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Virtual Machine identifier")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Virtual Machine identifier", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = 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.VMware.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded Clone() + { + var clone = new LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._restrictMovementBody = this._restrictMovementBody; + clone.VirtualMachineId = this.VirtualMachineId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the + /// cmdlet class. + /// + public LockAzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesRestrictMovement' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/virtualMachines/{(global::System.Uri.EscapeDataString(this.VirtualMachineId.ToString()))}"; + await this.Client.VirtualMachinesRestrictMovementViaIdentity(ClusterInputObject.Id, _restrictMovementBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.VirtualMachinesRestrictMovement(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, VirtualMachineId, _restrictMovementBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VirtualMachineId=VirtualMachineId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded.cs index 4a173e909937..cf840676645b 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Enable or disable DRS-driven VM movement restriction @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Enable or disable DRS-driven VM movement restriction")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement", ApiVersion = "2023-03-01")] public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpan /// 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; + /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IVirtualMachineRestrictMovement _restrictMovementBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.VirtualMachineRestrictMovement(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement _restrictMovementBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineRestrictMovement(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,18 +63,25 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -101,7 +124,7 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,21 +150,21 @@ public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpan ReadOnly = false, Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", SerializedName = @"restrictMovement", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState RestrictMovement { get => _restrictMovementBody.RestrictMovement ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState)""); set => _restrictMovementBody.RestrictMovement = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string RestrictMovement { get => _restrictMovementBody.RestrictMovement ?? null; set => _restrictMovementBody.RestrictMovement = 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -187,11 +210,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.LockAzVMwareVirtualMach /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded() @@ -243,11 +270,36 @@ public LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded() 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ public LockAzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -376,7 +444,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_restrictMovementBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -399,12 +467,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -421,15 +489,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_restrictMovementBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_restrictMovementBody }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..64a253a187d3 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,531 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Enable or disable DRS-driven VM movement restriction + /// + /// [OpenAPI] RestrictMovement=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Lock, @"AzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Enable or disable DRS-driven VM movement restriction")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/virtualMachines/{virtualMachineId}/restrictMovement", ApiVersion = "2023-03-01")] + public partial class LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// Set VM DRS-driven movement to restricted (enabled) or not (disabled) + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachineRestrictMovement _restrictMovementBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VirtualMachineRestrictMovement(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Whether VM DRS-driven movement is restricted (enabled) or not (disabled) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether VM DRS-driven movement is restricted (enabled) or not (disabled)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether VM DRS-driven movement is restricted (enabled) or not (disabled)", + SerializedName = @"restrictMovement", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string RestrictMovement { get => _restrictMovementBody.RestrictMovement ?? null; set => _restrictMovementBody.RestrictMovement = value; } + + /// Backing field for property. + private string _virtualMachineId; + + /// Virtual Machine identifier + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Virtual Machine identifier")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Virtual Machine identifier", + SerializedName = @"virtualMachineId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string VirtualMachineId { get => this._virtualMachineId; set => this._virtualMachineId = 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.VMware.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); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded Clone() + { + var clone = new LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._restrictMovementBody = this._restrictMovementBody; + clone.ClusterName = this.ClusterName; + clone.VirtualMachineId = this.VirtualMachineId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public LockAzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded() + { + + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesRestrictMovement' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/virtualMachines/{(global::System.Uri.EscapeDataString(this.VirtualMachineId.ToString()))}"; + await this.Client.VirtualMachinesRestrictMovementViaIdentity(PrivateCloudInputObject.Id, _restrictMovementBody, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.VirtualMachinesRestrictMovement(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, VirtualMachineId, _restrictMovementBody, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,VirtualMachineId=VirtualMachineId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 } + }); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateExpanded.cs index 642a7bab2cc5..b17a27e634ba 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a addon in a private cloud + /// Create a addon in a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareAddon_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a addon in a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a addon in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareAddon_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +34,25 @@ public partial class NewAzVMwareAddon_CreateExpanded : global::System.Management private string __processRecordId; /// An addon resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon _addonBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Addon(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon _addonBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon(); /// /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -47,18 +63,25 @@ public partial class NewAzVMwareAddon_CreateExpanded : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -108,7 +131,7 @@ public partial class NewAzVMwareAddon_CreateExpanded : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -132,8 +155,8 @@ public partial class NewAzVMwareAddon_CreateExpanded : global::System.Management ReadOnly = false, Description = @"The properties of an addon resource", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties Property { get => _addonBody.Property ?? null /* object */; set => _addonBody.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Property { get => _addonBody.Property ?? null /* object */; set => _addonBody.Property = value; } /// 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")] @@ -179,7 +202,8 @@ public partial class NewAzVMwareAddon_CreateExpanded : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -188,24 +212,24 @@ public partial class NewAzVMwareAddon_CreateExpanded : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IAddon + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon /// 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) @@ -253,7 +277,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareAddon_Create /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -300,11 +328,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -316,10 +369,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +398,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareAddon_CreateExpanded() { @@ -395,7 +464,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,12 +477,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AddonsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _addonBody, onOk, onDefault, this, Pipeline); + await this.Client.AddonsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _addonBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_addonBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -436,12 +505,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -458,15 +527,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_addonBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_addonBody }) + 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 } }); @@ -476,12 +545,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.VMware.Models.Api20211201.IAddon + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon /// 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 ) { @@ -493,8 +562,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..5dd51bd2ae4b --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateViaIdentityExpanded.cs @@ -0,0 +1,554 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a addon in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareAddon_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a addon in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareAddon_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// An addon resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon _addonBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// The properties of an addon resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The properties of an addon resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The properties of an addon resource", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Property { get => _addonBody.Property ?? null /* object */; set => _addonBody.Property = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IAddon + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareAddon_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareAddon_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareAddon_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._addonBody = this._addonBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareAddon_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AddonsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AddonsCreateOrUpdateViaIdentity(InputObject.Id, _addonBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AddonName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AddonName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AddonsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.AddonName ?? null, _addonBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IAddon + /// 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.VMware.Models.IAddon + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..b4e28e11baa7 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,567 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a addon in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareAddon_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a addon in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// An addon resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon _addonBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Addon(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the addon for the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the addon for the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the addon for the private cloud", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AddonName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// The properties of an addon resource + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The properties of an addon resource")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The properties of an addon resource", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Property { get => _addonBody.Property ?? null /* object */; set => _addonBody.Property = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IAddon + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._addonBody = this._addonBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareAddon_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AddonsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/addons/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AddonsCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _addonBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.AddonsCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _addonBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IAddon + /// 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.VMware.Models.IAddon + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateExpanded.cs index a1873274f4f9..994995db779d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update an ExpressRoute Circuit Authorization in a private cloud + /// Create an ExpressRoute Circuit Authorization in a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareAuthorization_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update an ExpressRoute Circuit Authorization in a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create an ExpressRoute Circuit Authorization in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareAuthorization_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -29,13 +33,25 @@ public partial class NewAzVMwareAuthorization_CreateExpanded : global::System.Ma private string __processRecordId; /// ExpressRoute Circuit Authorization - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ExpressRouteAuthorization(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization(); /// /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -46,18 +62,25 @@ public partial class NewAzVMwareAuthorization_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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 +130,7 @@ public partial class NewAzVMwareAuthorization_CreateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -167,7 +190,8 @@ public partial class NewAzVMwareAuthorization_CreateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -176,24 +200,24 @@ public partial class NewAzVMwareAuthorization_CreateExpanded : global::System.Ma /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IExpressRouteAuthorization + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization /// 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) @@ -241,7 +265,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareAuthorizatio /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -288,11 +316,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -304,10 +357,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -317,7 +386,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareAuthorization_CreateExpanded() { @@ -383,7 +452,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -396,12 +465,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AuthorizationsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _authorizationBody, onOk, onDefault, this, Pipeline); + await this.Client.AuthorizationsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _authorizationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_authorizationBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -424,12 +493,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -446,15 +515,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_authorizationBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_authorizationBody }) + 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 } }); @@ -464,12 +533,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.VMware.Models.Api20211201.IExpressRouteAuthorization + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization /// 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 ) { @@ -481,8 +550,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IExpressRouteAuthorization - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..7809dd07030d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateViaIdentityExpanded.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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareAuthorization_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create an ExpressRoute Circuit Authorization in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareAuthorization_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// ExpressRoute Circuit Authorization + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareAuthorization_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareAuthorization_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareAuthorization_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._authorizationBody = this._authorizationBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareAuthorization_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AuthorizationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.AuthorizationsCreateOrUpdateViaIdentity(InputObject.Id, _authorizationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AuthorizationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AuthorizationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.AuthorizationsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.AuthorizationName ?? null, _authorizationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..16ee458d7204 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,558 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create an ExpressRoute Circuit Authorization in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// ExpressRoute Circuit Authorization + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the ExpressRoute Circuit Authorization in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the ExpressRoute Circuit Authorization in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the ExpressRoute Circuit Authorization in the private cloud", + SerializedName = @"authorizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AuthorizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._authorizationBody = this._authorizationBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareAuthorization_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AuthorizationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/authorizations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AuthorizationsCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _authorizationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.AuthorizationsCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _authorizationBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateExpanded.cs index 18858966dfdf..639f524ba72c 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a cloud link in a private cloud + /// Create a cloud link in a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareCloudLink_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a cloud link in a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cloud link in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareCloudLink_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,7 +38,19 @@ public partial class NewAzVMwareCloudLink_CreateExpanded : global::System.Manage private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// A cloud link resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.CloudLink(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink(); + + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -46,18 +62,25 @@ public partial class NewAzVMwareCloudLink_CreateExpanded : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -118,7 +141,7 @@ public partial class NewAzVMwareCloudLink_CreateExpanded : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -178,7 +201,8 @@ public partial class NewAzVMwareCloudLink_CreateExpanded : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -187,24 +211,24 @@ public partial class NewAzVMwareCloudLink_CreateExpanded : global::System.Manage /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICloudLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink /// 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) @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareCloudLink_Cr /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +397,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareCloudLink_CreateExpanded() { @@ -394,7 +463,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -407,12 +476,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CloudLinksCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _cloudLinkBody, onOk, onDefault, this, Pipeline); + await this.Client.CloudLinksCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _cloudLinkBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_cloudLinkBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_cloudLinkBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_cloudLinkBody }) + 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 } }); @@ -475,12 +544,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.VMware.Models.Api20211201.ICloudLink + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink /// 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 ) { @@ -492,8 +561,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICloudLink - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..ec017a5e9fe7 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateViaIdentityExpanded.cs @@ -0,0 +1,553 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cloud link in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareCloudLink_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cloud link in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareCloudLink_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cloud link resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Identifier of the other private cloud participating in the link. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the other private cloud participating in the link.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the other private cloud participating in the link.", + SerializedName = @"linkedCloud", + PossibleTypes = new [] { typeof(string) })] + public string LinkedCloud { get => _cloudLinkBody.LinkedCloud ?? null; set => _cloudLinkBody.LinkedCloud = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareCloudLink_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareCloudLink_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareCloudLink_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloudLinkBody = this._cloudLinkBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareCloudLink_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudLinksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.CloudLinksCreateOrUpdateViaIdentity(InputObject.Id, _cloudLinkBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.CloudLinkName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CloudLinkName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.CloudLinksCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.CloudLinkName ?? null, _cloudLinkBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..2e4b34aae3f7 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,568 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cloud link in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cloud link in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cloud link resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// Identifier of the other private cloud participating in the link. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the other private cloud participating in the link.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the other private cloud participating in the link.", + SerializedName = @"linkedCloud", + PossibleTypes = new [] { typeof(string) })] + public string LinkedCloud { get => _cloudLinkBody.LinkedCloud ?? null; set => _cloudLinkBody.LinkedCloud = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cloud link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cloud link resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cloud link resource", + SerializedName = @"cloudLinkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudLinkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloudLinkBody = this._cloudLinkBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareCloudLink_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudLinksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/cloudLinks/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.CloudLinksCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _cloudLinkBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.CloudLinksCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _cloudLinkBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateExpanded.cs index e530ed132e8d..8fb2ae288035 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a cluster in a private cloud + /// Create a cluster in a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareCluster_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a cluster in a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cluster in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareCluster_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,7 +38,19 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// A cluster resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster _clusterBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Cluster(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster _clusterBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster(); + + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -46,6 +62,9 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -61,14 +80,18 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme public int ClusterSize { get => _clusterBody.Size ?? default(int); set => _clusterBody.Size = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -118,7 +141,7 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -144,7 +167,7 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - public string[] PropertiesHost { get => _clusterBody.Host ?? null /* arrayOf */; set => _clusterBody.Host = value; } + public string[] PropertiesHost { get => _clusterBody.Host?.ToArray() ?? null /* fixedArrayOf */; set => _clusterBody.Host = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -201,7 +224,8 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -210,24 +234,24 @@ public partial class NewAzVMwareCluster_CreateExpanded : global::System.Manageme /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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) @@ -275,7 +299,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareCluster_Crea /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -322,11 +350,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -338,10 +391,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -351,7 +420,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareCluster_CreateExpanded() { @@ -417,7 +486,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -430,12 +499,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _clusterBody, onOk, onDefault, this, Pipeline); + await this.Client.ClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _clusterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_clusterBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -458,12 +527,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -480,15 +549,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_clusterBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_clusterBody }) + 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 } }); @@ -498,12 +567,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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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 ) { @@ -515,8 +584,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..8e0fb6f15629 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateViaIdentityExpanded.cs @@ -0,0 +1,576 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cluster in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareCluster_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cluster in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareCluster_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cluster resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster _clusterBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// The cluster size + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The cluster size")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster size", + SerializedName = @"clusterSize", + PossibleTypes = new [] { typeof(int) })] + public int ClusterSize { get => _clusterBody.Size ?? default(int); set => _clusterBody.Size = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// The hosts + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The hosts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The hosts", + SerializedName = @"hosts", + PossibleTypes = new [] { typeof(string) })] + public string[] PropertiesHost { get => _clusterBody.Host?.ToArray() ?? null /* fixedArrayOf */; set => _clusterBody.Host = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the SKU. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the SKU.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string SkuName { get => _clusterBody.SkuName ?? null; set => _clusterBody.SkuName = 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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareCluster_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareCluster_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareCluster_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._clusterBody = this._clusterBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareCluster_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ClustersCreateOrUpdateViaIdentity(InputObject.Id, _clusterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ClustersCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, _clusterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..39ae54148b2e --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,591 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cluster in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareCluster_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cluster in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cluster resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster _clusterBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Cluster(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// The cluster size + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The cluster size")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster size", + SerializedName = @"clusterSize", + PossibleTypes = new [] { typeof(int) })] + public int ClusterSize { get => _clusterBody.Size ?? default(int); set => _clusterBody.Size = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// The hosts + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The hosts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The hosts", + SerializedName = @"hosts", + PossibleTypes = new [] { typeof(string) })] + public string[] PropertiesHost { get => _clusterBody.Host?.ToArray() ?? null /* fixedArrayOf */; set => _clusterBody.Host = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The name of the SKU. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the SKU.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string SkuName { get => _clusterBody.SkuName ?? null; set => _clusterBody.SkuName = 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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._clusterBody = this._clusterBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareCluster_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ClustersCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _clusterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ClustersCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _clusterBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateExpanded.cs index a3e4fcd6e9a7..abde61dc6c73 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a datastore in a private cloud cluster + /// Create a datastore in a private cloud cluster /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareDatastore_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a datastore in a private cloud cluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,7 +38,19 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// A datastore resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.Datastore(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -46,6 +62,9 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -64,9 +83,10 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -93,9 +113,9 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage ReadOnly = false, Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", SerializedName = @"mountOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum)""); set => _datastoreBody.DiskPoolVolumeMountOption = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } /// Azure resource ID of the iSCSI target [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] @@ -108,6 +128,9 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage PossibleTypes = new [] { typeof(string) })] public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] @@ -168,7 +191,7 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -228,7 +251,8 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -237,24 +261,24 @@ public partial class NewAzVMwareDatastore_CreateExpanded : global::System.Manage /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IDatastore + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore /// 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) @@ -303,7 +327,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareDatastore_Cr /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -350,11 +378,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -366,10 +419,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -379,7 +448,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareDatastore_CreateExpanded() { @@ -445,7 +514,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -458,12 +527,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.DatastoresCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _datastoreBody, onOk, onDefault, this, Pipeline); + await this.Client.DatastoresCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name,body=_datastoreBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -486,12 +555,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -508,15 +577,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name, body=_datastoreBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name, body=_datastoreBody }) + 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 } }); @@ -526,12 +595,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.VMware.Models.Api20211201.IDatastore + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore /// 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 ) { @@ -543,8 +612,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IDatastore - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityClusterExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..2de7a72dfc4a --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityClusterExpanded.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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareDatastore_CreateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareDatastore_CreateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareDatastore_CreateViaIdentityClusterExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareDatastore_CreateViaIdentityClusterExpanded Clone() + { + var clone = new NewAzVMwareDatastore_CreateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareDatastore_CreateViaIdentityClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DatastoresCreateOrUpdateViaIdentity(ClusterInputObject.Id, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.DatastoresCreateOrUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..f529c5e1003f --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityExpanded.cs @@ -0,0 +1,593 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareDatastore_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareDatastore_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareDatastore_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareDatastore_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareDatastore_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareDatastore_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DatastoresCreateOrUpdateViaIdentity(InputObject.Id, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DatastoreName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DatastoreName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DatastoresCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, InputObject.DatastoreName ?? null, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..57934c29dda5 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,619 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareDatastore_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DatastoresCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.DatastoresCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, _datastoreBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateExpanded.cs index 366fa8b8c521..29ded30e4b2a 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a global reach connection in a private cloud + /// Create a global reach connection in a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareGlobalReachConnection_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a global reach connection in a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a global reach connection in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,8 +37,20 @@ public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::S /// 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 global reach connection resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.GlobalReachConnection(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection(); + + /// + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -59,13 +75,17 @@ public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -84,6 +104,9 @@ public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::S PossibleTypes = new [] { typeof(string) })] public string ExpressRouteId { get => _globalReachConnectionBody.ExpressRouteId ?? null; set => _globalReachConnectionBody.ExpressRouteId = 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] @@ -146,7 +169,7 @@ public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -206,7 +229,8 @@ public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::S [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -215,24 +239,24 @@ public partial class NewAzVMwareGlobalReachConnection_CreateExpanded : global::S /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IGlobalReachConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection /// 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) @@ -280,7 +304,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareGlobalReachC /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -327,11 +355,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -343,10 +396,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -356,7 +425,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareGlobalReachConnection_CreateExpanded() { @@ -422,7 +491,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -435,12 +504,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.GlobalReachConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _globalReachConnectionBody, onOk, onDefault, this, Pipeline); + await this.Client.GlobalReachConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _globalReachConnectionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_globalReachConnectionBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -463,12 +532,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -485,15 +554,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_globalReachConnectionBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_globalReachConnectionBody }) + 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 } }); @@ -503,12 +572,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.VMware.Models.Api20211201.IGlobalReachConnection + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection /// 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 ) { @@ -520,8 +589,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IGlobalReachConnection - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..521a956c1d95 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded.cs @@ -0,0 +1,583 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a global reach connection in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareGlobalReachConnection_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a global reach connection in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 global reach connection resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Authorization key from the peer express route used for the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authorization key from the peer express route used for the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization key from the peer express route used for the global reach connection", + SerializedName = @"authorizationKey", + PossibleTypes = new [] { typeof(string) })] + public string AuthorizationKey { get => _globalReachConnectionBody.AuthorizationKey ?? null; set => _globalReachConnectionBody.AuthorizationKey = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", + SerializedName = @"expressRouteId", + PossibleTypes = new [] { typeof(string) })] + public string ExpressRouteId { get => _globalReachConnectionBody.ExpressRouteId ?? null; set => _globalReachConnectionBody.ExpressRouteId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Identifier of the ExpressRoute Circuit to peer with in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the ExpressRoute Circuit to peer with in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", + SerializedName = @"peerExpressRouteCircuit", + PossibleTypes = new [] { typeof(string) })] + public string PeerExpressRouteResourceId { get => _globalReachConnectionBody.PeerExpressRouteCircuit ?? null; set => _globalReachConnectionBody.PeerExpressRouteCircuit = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._globalReachConnectionBody = this._globalReachConnectionBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareGlobalReachConnection_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GlobalReachConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.GlobalReachConnectionsCreateOrUpdateViaIdentity(InputObject.Id, _globalReachConnectionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GlobalReachConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GlobalReachConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.GlobalReachConnectionsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.GlobalReachConnectionName ?? null, _globalReachConnectionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..04482871f45b --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,597 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a global reach connection in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a global reach connection in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 global reach connection resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Authorization key from the peer express route used for the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authorization key from the peer express route used for the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization key from the peer express route used for the global reach connection", + SerializedName = @"authorizationKey", + PossibleTypes = new [] { typeof(string) })] + public string AuthorizationKey { get => _globalReachConnectionBody.AuthorizationKey ?? null; set => _globalReachConnectionBody.AuthorizationKey = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", + SerializedName = @"expressRouteId", + PossibleTypes = new [] { typeof(string) })] + public string ExpressRouteId { get => _globalReachConnectionBody.ExpressRouteId ?? null; set => _globalReachConnectionBody.ExpressRouteId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the global reach connection in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the global reach connection in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the global reach connection in the private cloud", + SerializedName = @"globalReachConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GlobalReachConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Identifier of the ExpressRoute Circuit to peer with in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the ExpressRoute Circuit to peer with in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", + SerializedName = @"peerExpressRouteCircuit", + PossibleTypes = new [] { typeof(string) })] + public string PeerExpressRouteResourceId { get => _globalReachConnectionBody.PeerExpressRouteCircuit ?? null; set => _globalReachConnectionBody.PeerExpressRouteCircuit = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._globalReachConnectionBody = this._globalReachConnectionBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareGlobalReachConnection_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GlobalReachConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/globalReachConnections/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.GlobalReachConnectionsCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _globalReachConnectionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.GlobalReachConnectionsCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _globalReachConnectionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateExpanded.cs index b385fa7fc446..e02a16121cb4 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a placement policy in a private cloud cluster + /// Create a placement policy in a private cloud cluster /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwarePlacementPolicy_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a placement policy in a private cloud cluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a placement policy in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,8 +37,20 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. /// 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 vSphere Distributed Resource Scheduler (DRS) placement policy - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy _placementPolicyBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicy(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy _placementPolicyBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy(); + + /// + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -46,6 +62,9 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -64,14 +83,18 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -123,7 +146,7 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -147,8 +170,8 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. ReadOnly = false, Description = @"placement policy properties", SerializedName = @"properties", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties Property { get => _placementPolicyBody.Property ?? null /* object */; set => _placementPolicyBody.Property = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get => _placementPolicyBody.Property ?? null /* object */; set => _placementPolicyBody.Property = value; } /// 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")] @@ -194,7 +217,8 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -203,24 +227,24 @@ public partial class NewAzVMwarePlacementPolicy_CreateExpanded : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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) @@ -269,7 +293,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePlacementPol /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -316,11 +344,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -332,10 +385,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -345,7 +414,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwarePlacementPolicy_CreateExpanded() { @@ -411,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -424,12 +493,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PlacementPoliciesCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _placementPolicyBody, onOk, onDefault, this, Pipeline); + await this.Client.PlacementPoliciesCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name,body=_placementPolicyBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -452,12 +521,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -474,15 +543,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name, body=_placementPolicyBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name, body=_placementPolicyBody }) + 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 } }); @@ -492,12 +561,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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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 ) { @@ -509,8 +578,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..3019a6e64d31 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded.cs @@ -0,0 +1,574 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a placement policy in a private cloud cluster + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 vSphere Distributed Resource Scheduler (DRS) placement policy + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy _placementPolicyBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// placement policy properties + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy properties", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get => _placementPolicyBody.Property ?? null /* object */; set => _placementPolicyBody.Property = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded Clone() + { + var clone = new NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._placementPolicyBody = this._placementPolicyBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwarePlacementPolicy_CreateViaIdentityClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesCreateOrUpdateViaIdentity(ClusterInputObject.Id, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.PlacementPoliciesCreateOrUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..5e5adc7e967b --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded.cs @@ -0,0 +1,557 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a placement policy in a private cloud cluster + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwarePlacementPolicy_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 vSphere Distributed Resource Scheduler (DRS) placement policy + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy _placementPolicyBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// placement policy properties + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy properties", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get => _placementPolicyBody.Property ?? null /* object */; set => _placementPolicyBody.Property = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._placementPolicyBody = this._placementPolicyBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwarePlacementPolicy_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PlacementPoliciesCreateOrUpdateViaIdentity(InputObject.Id, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PlacementPolicyName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PlacementPolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PlacementPoliciesCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, InputObject.PlacementPolicyName ?? null, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..f97a103c86db --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,586 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a placement policy in a private cloud cluster + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 vSphere Distributed Resource Scheduler (DRS) placement policy + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy _placementPolicyBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicy(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// placement policy properties + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy properties")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy properties", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Property { get => _placementPolicyBody.Property ?? null /* object */; set => _placementPolicyBody.Property = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._placementPolicyBody = this._placementPolicyBody; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwarePlacementPolicy_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.PlacementPoliciesCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, _placementPolicyBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_Rotate.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_Rotate.cs index 906d4b5a0621..21aec2802a7a 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_Rotate.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_Rotate.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Rotate the NSX-T Manager password @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Rotate the NSX-T Manager password")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword", ApiVersion = "2023-03-01")] public partial class NewAzVMwarePrivateCloudNsxtPassword_Rotate : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_Rotate : global::System /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_Rotate : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -96,7 +119,7 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_Rotate : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -156,7 +179,8 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_Rotate : global::System [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -165,12 +189,12 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_Rotate : global::System /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -226,7 +250,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePrivateCloud /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -273,11 +301,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -289,10 +342,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -302,7 +371,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwarePrivateCloudNsxtPassword_Rotate() { @@ -368,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -386,7 +455,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -409,12 +478,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -431,15 +500,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity.cs index 3aa1f1231bbb..ab0f6d122e1a 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Rotate the NSX-T Manager password @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Rotate the NSX-T Manager password")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateNsxtPassword", ApiVersion = "2023-03-01")] public partial class NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity : glo /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity : glo /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -185,7 +208,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePrivateCloud /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -232,11 +259,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -248,10 +300,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -261,7 +329,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwarePrivateCloudNsxtPassword_RotateViaIdentity() { @@ -327,7 +395,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -365,7 +433,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,12 +456,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -410,7 +478,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_Rotate.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_Rotate.cs index b99a216c1f2a..4ef1f0233909 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_Rotate.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_Rotate.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Rotate the vCenter password @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Rotate the vCenter password")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword", ApiVersion = "2023-03-01")] public partial class NewAzVMwarePrivateCloudVcenterPassword_Rotate : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_Rotate : global::Sys /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_Rotate : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -96,7 +119,7 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_Rotate : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -156,7 +179,8 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_Rotate : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -165,12 +189,12 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_Rotate : global::Sys /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -226,7 +250,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePrivateCloud /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -273,11 +301,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -289,10 +342,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -302,7 +371,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwarePrivateCloudVcenterPassword_Rotate() { @@ -368,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -386,7 +455,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -409,12 +478,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -431,15 +500,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity.cs index 2ca256b12996..b5cd5581c2ac 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Rotate the vCenter password @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Rotate the vCenter password")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/rotateVcenterPassword", ApiVersion = "2023-03-01")] public partial class NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity : /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity : /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -187,7 +210,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePrivateCloud /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -234,11 +261,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -250,10 +302,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -263,7 +331,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwarePrivateCloudVcenterPassword_RotateViaIdentity() { @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -367,7 +435,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -390,12 +458,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -412,7 +480,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloud_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloud_CreateExpanded.cs index 96146616f199..8f55302b90eb 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloud_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwarePrivateCloud_CreateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a private cloud + /// Create a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwarePrivateCloud_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : 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 private cloud resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud _privateCloudBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloud(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud _privateCloudBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloud(); + + /// + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -61,9 +77,9 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man ReadOnly = false, Description = @"The availability strategy for the private cloud", SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy AvailabilityStrategy { get => _privateCloudBody.AvailabilityStrategy ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); set => _privateCloudBody.AvailabilityStrategy = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] + public string AvailabilityStrategy { get => _privateCloudBody.AvailabilityStrategy ?? null; set => _privateCloudBody.AvailabilityStrategy = value; } /// The primary availability zone for the private cloud [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The primary availability zone for the private cloud")] @@ -81,13 +97,17 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -101,9 +121,28 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Status of customer managed encryption key", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState EncryptionStatus { get => _privateCloudBody.EncryptionStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); set => _privateCloudBody.EncryptionStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string EncryptionStatus { get => _privateCloudBody.EncryptionStatus ?? null; set => _privateCloudBody.EncryptionStatus = value; } + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).", + SerializedName = @"extendedNetworkBlocks", + PossibleTypes = new [] { typeof(string) })] + public string[] ExtendedNetworkBlock { get => _privateCloudBody.ExtendedNetworkBlock?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudBody.ExtendedNetworkBlock = (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")] @@ -126,8 +165,8 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man ReadOnly = false, Description = @"vCenter Single Sign On Identity Sources", SerializedName = @"identitySources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => _privateCloudBody.IdentitySource ?? null /* arrayOf */; set => _privateCloudBody.IdentitySource = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] IdentitySource { get => _privateCloudBody.IdentitySource?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudBody.IdentitySource = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The @@ -140,9 +179,9 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man ReadOnly = false, Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType IdentityType { get => _privateCloudBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType)""); set => _privateCloudBody.IdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + public string IdentityType { get => _privateCloudBody.IdentityType ?? null; set => _privateCloudBody.IdentityType = value; } /// Connectivity to internet is enabled or disabled [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Connectivity to internet is enabled or disabled")] @@ -152,9 +191,9 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Connectivity to internet is enabled or disabled", SerializedName = @"internet", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum Internet { get => _privateCloudBody.Internet ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum)""); set => _privateCloudBody.Internet = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string Internet { get => _privateCloudBody.Internet ?? null; set => _privateCloudBody.Internet = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -213,7 +252,7 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - public string[] ManagementClusterHost { get => _privateCloudBody.ManagementClusterHost ?? null /* arrayOf */; set => _privateCloudBody.ManagementClusterHost = value; } + public string[] ManagementClusterHost { get => _privateCloudBody.ManagementClusterHost?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudBody.ManagementClusterHost = (value != null ? new System.Collections.Generic.List(value) : null); } /// The cluster size [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The cluster size")] @@ -285,7 +324,7 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -342,7 +381,8 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -355,8 +395,8 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get => _privateCloudBody.Tag ?? null /* object */; set => _privateCloudBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get => _privateCloudBody.Tag ?? null /* object */; set => _privateCloudBody.Tag = value; } /// Optionally, set the vCenter admin password when the private cloud is created [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optionally, set the vCenter admin password when the private cloud is created")] @@ -374,24 +414,24 @@ public partial class NewAzVMwarePrivateCloud_CreateExpanded : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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) @@ -438,7 +478,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwarePrivateCloud /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -485,11 +529,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -501,10 +570,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -514,7 +599,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwarePrivateCloud_CreateExpanded() { @@ -580,7 +665,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -593,12 +678,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateCloudsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _privateCloudBody, onOk, onDefault, this, Pipeline); + await this.Client.PrivateCloudsCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, _privateCloudBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,body=_privateCloudBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -621,12 +706,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -643,15 +728,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_privateCloudBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_privateCloudBody }) + 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 } }); @@ -661,12 +746,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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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 ) { @@ -678,8 +763,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateExpanded.cs index 0201973cecc1..cde2c4cfd80f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a script execution in a private cloud + /// Create a script execution in a private cloud /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareScriptExecution_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a script execution in a private cloud")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a script execution in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. /// 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; + /// An instance of a script executed by a user - custom or AVS - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution _scriptExecutionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ScriptExecution(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution _scriptExecutionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,18 +63,25 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception /// @@ -83,8 +106,8 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. ReadOnly = false, Description = @"Parameters that will be hidden/not visible to ARM, such as passwords and credentials", SerializedName = @"hiddenParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] HiddenParameter { get => _scriptExecutionBody.HiddenParameter ?? null /* arrayOf */; set => _scriptExecutionBody.HiddenParameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[] HiddenParameter { get => _scriptExecutionBody.HiddenParameter?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.HiddenParameter = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -133,8 +156,8 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. ReadOnly = false, Description = @"User-defined dictionary.", SerializedName = @"namedOutputs", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => _scriptExecutionBody.NamedOutput ?? null /* object */; set => _scriptExecutionBody.NamedOutput = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => _scriptExecutionBody.NamedOutput ?? null /* object */; set => _scriptExecutionBody.NamedOutput = value; } /// /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue @@ -154,7 +177,7 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. Description = @"Standard output stream from the powershell execution", SerializedName = @"output", PossibleTypes = new [] { typeof(string) })] - public string[] Output { get => _scriptExecutionBody.Output ?? null /* arrayOf */; set => _scriptExecutionBody.Output = value; } + public string[] Output { get => _scriptExecutionBody.Output?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.Output = (value != null ? new System.Collections.Generic.List(value) : null); } /// Parameters the script will accept [global::System.Management.Automation.AllowEmptyCollection] @@ -165,13 +188,13 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. ReadOnly = false, Description = @"Parameters the script will accept", SerializedName = @"parameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[] Parameter { get => _scriptExecutionBody.Parameter ?? null /* arrayOf */; set => _scriptExecutionBody.Parameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[] Parameter { get => _scriptExecutionBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -253,7 +276,8 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -273,24 +297,24 @@ public partial class NewAzVMwareScriptExecution_CreateExpanded : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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) @@ -338,7 +362,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareScriptExecut /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -385,11 +413,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -401,10 +454,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -414,7 +483,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareScriptExecution_CreateExpanded() { @@ -480,7 +549,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -493,12 +562,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ScriptExecutionsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _scriptExecutionBody, onOk, onDefault, this, Pipeline); + await this.Client.ScriptExecutionsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _scriptExecutionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_scriptExecutionBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -521,12 +590,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -543,15 +612,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_scriptExecutionBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_scriptExecutionBody }) + 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 } }); @@ -561,12 +630,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.VMware.Models.Api20211201.IScriptExecution + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution /// 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 ) { @@ -578,8 +647,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..178dd0d86c57 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateViaIdentityExpanded.cs @@ -0,0 +1,639 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a script execution in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareScriptExecution_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a script execution in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareScriptExecution_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// An instance of a script executed by a user - custom or AVS + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution _scriptExecutionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// + /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Error message if the script was able to run, but if the script itself had errors or powershell threw an exception")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message if the script was able to run, but if the script itself had errors or powershell threw an exception", + SerializedName = @"failureReason", + PossibleTypes = new [] { typeof(string) })] + public string FailureReason { get => _scriptExecutionBody.FailureReason ?? null; set => _scriptExecutionBody.FailureReason = value; } + + /// + /// Parameters that will be hidden/not visible to ARM, such as passwords and credentials + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Parameters that will be hidden/not visible to ARM, such as passwords and credentials")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameters that will be hidden/not visible to ARM, such as passwords and credentials", + SerializedName = @"hiddenParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[] HiddenParameter { get => _scriptExecutionBody.HiddenParameter?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.HiddenParameter = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// User-defined dictionary. + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User-defined dictionary.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-defined dictionary.", + SerializedName = @"namedOutputs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => _scriptExecutionBody.NamedOutput ?? null /* object */; set => _scriptExecutionBody.NamedOutput = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Standard output stream from the powershell execution + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Standard output stream from the powershell execution")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Standard output stream from the powershell execution", + SerializedName = @"output", + PossibleTypes = new [] { typeof(string) })] + public string[] Output { get => _scriptExecutionBody.Output?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.Output = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Parameters the script will accept + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Parameters the script will accept")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameters the script will accept", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[] Parameter { get => _scriptExecutionBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time to live for the resource. If not provided, will be available for 60 days + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time to live for the resource. If not provided, will be available for 60 days")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time to live for the resource. If not provided, will be available for 60 days", + SerializedName = @"retention", + PossibleTypes = new [] { typeof(string) })] + public string Retention { get => _scriptExecutionBody.Retention ?? null; set => _scriptExecutionBody.Retention = value; } + + /// A reference to the script cmdlet resource if user is running a AVS script + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A reference to the script cmdlet resource if user is running a AVS script")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A reference to the script cmdlet resource if user is running a AVS script", + SerializedName = @"scriptCmdletId", + PossibleTypes = new [] { typeof(string) })] + public string ScriptCmdletId { get => _scriptExecutionBody.ScriptCmdletId ?? null; set => _scriptExecutionBody.ScriptCmdletId = value; } + + /// Time limit for execution + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time limit for execution")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time limit for execution", + SerializedName = @"timeout", + PossibleTypes = new [] { typeof(string) })] + public string Timeout { get => _scriptExecutionBody.Timeout ?? null; set => _scriptExecutionBody.Timeout = 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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzVMwareScriptExecution_CreateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareScriptExecution_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareScriptExecution_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._scriptExecutionBody = this._scriptExecutionBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareScriptExecution_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScriptExecutionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ScriptExecutionsCreateOrUpdateViaIdentity(InputObject.Id, _scriptExecutionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ScriptExecutionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ScriptExecutionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ScriptExecutionsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ScriptExecutionName ?? null, _scriptExecutionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..82da6cbe15e6 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,655 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a script execution in a private cloud + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a script execution in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// An instance of a script executed by a user - custom or AVS + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution _scriptExecutionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptExecution(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// + /// Error message if the script was able to run, but if the script itself had errors or powershell threw an exception + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Error message if the script was able to run, but if the script itself had errors or powershell threw an exception")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Error message if the script was able to run, but if the script itself had errors or powershell threw an exception", + SerializedName = @"failureReason", + PossibleTypes = new [] { typeof(string) })] + public string FailureReason { get => _scriptExecutionBody.FailureReason ?? null; set => _scriptExecutionBody.FailureReason = value; } + + /// + /// Parameters that will be hidden/not visible to ARM, such as passwords and credentials + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Parameters that will be hidden/not visible to ARM, such as passwords and credentials")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameters that will be hidden/not visible to ARM, such as passwords and credentials", + SerializedName = @"hiddenParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[] HiddenParameter { get => _scriptExecutionBody.HiddenParameter?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.HiddenParameter = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the user-invoked script execution resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the user-invoked script execution resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the user-invoked script execution resource", + SerializedName = @"scriptExecutionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ScriptExecutionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// User-defined dictionary. + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "User-defined dictionary.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"User-defined dictionary.", + SerializedName = @"namedOutputs", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs NamedOutput { get => _scriptExecutionBody.NamedOutput ?? null /* object */; set => _scriptExecutionBody.NamedOutput = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Standard output stream from the powershell execution + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Standard output stream from the powershell execution")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Standard output stream from the powershell execution", + SerializedName = @"output", + PossibleTypes = new [] { typeof(string) })] + public string[] Output { get => _scriptExecutionBody.Output?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.Output = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Parameters the script will accept + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Parameters the script will accept")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Parameters the script will accept", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[] Parameter { get => _scriptExecutionBody.Parameter?.ToArray() ?? null /* fixedArrayOf */; set => _scriptExecutionBody.Parameter = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Time to live for the resource. If not provided, will be available for 60 days + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time to live for the resource. If not provided, will be available for 60 days")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time to live for the resource. If not provided, will be available for 60 days", + SerializedName = @"retention", + PossibleTypes = new [] { typeof(string) })] + public string Retention { get => _scriptExecutionBody.Retention ?? null; set => _scriptExecutionBody.Retention = value; } + + /// A reference to the script cmdlet resource if user is running a AVS script + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A reference to the script cmdlet resource if user is running a AVS script")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A reference to the script cmdlet resource if user is running a AVS script", + SerializedName = @"scriptCmdletId", + PossibleTypes = new [] { typeof(string) })] + public string ScriptCmdletId { get => _scriptExecutionBody.ScriptCmdletId ?? null; set => _scriptExecutionBody.ScriptCmdletId = value; } + + /// Time limit for execution + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Time limit for execution")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Time limit for execution", + SerializedName = @"timeout", + PossibleTypes = new [] { typeof(string) })] + public string Timeout { get => _scriptExecutionBody.Timeout ?? null; set => _scriptExecutionBody.Timeout = 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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._scriptExecutionBody = this._scriptExecutionBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScriptExecutionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/scriptExecutions/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ScriptExecutionsCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _scriptExecutionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ScriptExecutionsCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _scriptExecutionBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IScriptExecution + /// 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.VMware.Models.IScriptExecution + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateExpanded.cs index 30804f6c9bdd..3efec62d2eee 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create dhcp by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDhcp_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys /// 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; + /// NSX DHCP - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -81,9 +101,9 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys ReadOnly = false, Description = @"Type of DHCP: SERVER or RELAY.", SerializedName = @"dhcpType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum)""); set => _workloadNetworkDhcpBody.DhcpType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + public string DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? null; set => _workloadNetworkDhcpBody.DhcpType = value; } /// Display name of the DHCP entity. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DHCP entity.")] @@ -96,6 +116,9 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkDhcpBody.DisplayName ?? null; set => _workloadNetworkDhcpBody.DisplayName = 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] @@ -130,7 +153,7 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -201,7 +224,8 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -210,24 +234,24 @@ public partial class NewAzVMwareWorkloadNetworkDhcp_CreateExpanded : global::Sys /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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) @@ -275,7 +299,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -322,11 +350,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -338,10 +391,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -351,7 +420,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkDhcp_CreateExpanded() { @@ -417,7 +486,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -430,12 +499,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreateDhcp(SubscriptionId, ResourceGroupName, PrivateCloudName, DhcpName, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreateDhcp(SubscriptionId, ResourceGroupName, PrivateCloudName, DhcpName, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DhcpName=DhcpName,body=_workloadNetworkDhcpBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DhcpName=DhcpName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -458,12 +527,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -480,15 +549,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DhcpName=DhcpName, body=_workloadNetworkDhcpBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DhcpName=DhcpName, body=_workloadNetworkDhcpBody }) + 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 } }); @@ -498,12 +567,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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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 ) { @@ -515,8 +584,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..7292fd89fc33 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded.cs @@ -0,0 +1,579 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create dhcp by id in a private cloud workload network. + /// + /// [OpenAPI] CreateDhcp=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create dhcp by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DHCP + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Type of DHCP: SERVER or RELAY. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of DHCP: SERVER or RELAY.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of DHCP: SERVER or RELAY.", + SerializedName = @"dhcpType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + public string DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? null; set => _workloadNetworkDhcpBody.DhcpType = value; } + + /// Display name of the DHCP entity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DHCP entity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DHCP entity.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDhcpBody.DisplayName ?? null; set => _workloadNetworkDhcpBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDhcpBody.Revision ?? default(long); set => _workloadNetworkDhcpBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDhcpBody = this._workloadNetworkDhcpBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateDhcp' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreateDhcpViaIdentity(InputObject.Id, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DhcpId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DhcpId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreateDhcp(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DhcpId ?? null, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..aa41bf1703ab --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,592 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create dhcp by id in a private cloud workload network. + /// + /// [OpenAPI] CreateDhcp=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create dhcp by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DHCP + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _dhcpName; + + /// NSX DHCP identifier. Generally the same as the DHCP display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DHCP identifier. Generally the same as the DHCP display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DHCP identifier. Generally the same as the DHCP display name", + SerializedName = @"dhcpId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DhcpName { get => this._dhcpName; set => this._dhcpName = value; } + + /// Type of DHCP: SERVER or RELAY. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of DHCP: SERVER or RELAY.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of DHCP: SERVER or RELAY.", + SerializedName = @"dhcpType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + public string DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? null; set => _workloadNetworkDhcpBody.DhcpType = value; } + + /// Display name of the DHCP entity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DHCP entity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DHCP entity.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDhcpBody.DisplayName ?? null; set => _workloadNetworkDhcpBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDhcpBody.Revision ?? default(long); set => _workloadNetworkDhcpBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDhcpBody = this._workloadNetworkDhcpBody; + clone.DhcpName = this.DhcpName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateDhcp' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dhcpConfigurations/{(global::System.Uri.EscapeDataString(this.DhcpName.ToString()))}"; + await this.Client.WorkloadNetworksCreateDhcpViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreateDhcp(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DhcpName, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DhcpName=DhcpName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateExpanded.cs index a44f0cc803c7..ce4fa40fc01d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create a DNS service by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDnsService_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa /// 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; + /// NSX DNS Service - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,9 +81,10 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa public string DefaultDnsZone { get => _workloadNetworkDnsServiceBody.DefaultDnsZone ?? null; set => _workloadNetworkDnsServiceBody.DefaultDnsZone = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -108,6 +128,9 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// FQDN zones of the DNS Service. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "FQDN zones of the DNS Service.")] @@ -118,7 +141,7 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa Description = @"FQDN zones of the DNS Service.", SerializedName = @"fqdnZones", PossibleTypes = new [] { typeof(string) })] - public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone ?? null /* arrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = value; } + public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -143,9 +166,9 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa ReadOnly = false, Description = @"DNS Service log level.", SerializedName = @"logLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum)""); set => _workloadNetworkDnsServiceBody.LogLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + public string LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? null; set => _workloadNetworkDnsServiceBody.LogLevel = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -166,7 +189,7 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -237,7 +260,8 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -246,24 +270,24 @@ public partial class NewAzVMwareWorkloadNetworkDnsService_CreateExpanded : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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) @@ -311,7 +335,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -358,11 +386,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -374,10 +427,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -387,7 +456,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkDnsService_CreateExpanded() { @@ -453,7 +522,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -466,12 +535,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreateDnsService(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsServiceName, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreateDnsService(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsServiceName, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DnsServiceName=DnsServiceName,body=_workloadNetworkDnsServiceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DnsServiceName=DnsServiceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -494,12 +563,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -516,15 +585,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsServiceName=DnsServiceName, body=_workloadNetworkDnsServiceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsServiceName=DnsServiceName, body=_workloadNetworkDnsServiceBody }) + 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 } }); @@ -534,12 +603,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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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 ) { @@ -551,8 +620,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..ea68ca2df447 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded.cs @@ -0,0 +1,614 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a DNS service by id in a private cloud workload network. + /// + /// [OpenAPI] CreateDnsService=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a DNS service by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DNS Service + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Default DNS zone of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Default DNS zone of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default DNS zone of the DNS Service.", + SerializedName = @"defaultDnsZone", + PossibleTypes = new [] { typeof(string) })] + public string DefaultDnsZone { get => _workloadNetworkDnsServiceBody.DefaultDnsZone ?? null; set => _workloadNetworkDnsServiceBody.DefaultDnsZone = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DNS Service.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDnsServiceBody.DisplayName ?? null; set => _workloadNetworkDnsServiceBody.DisplayName = value; } + + /// DNS service IP of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS service IP of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS service IP of the DNS Service.", + SerializedName = @"dnsServiceIp", + PossibleTypes = new [] { typeof(string) })] + public string DnsServiceIP { get => _workloadNetworkDnsServiceBody.DnsServiceIP ?? null; set => _workloadNetworkDnsServiceBody.DnsServiceIP = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// FQDN zones of the DNS Service. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "FQDN zones of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"FQDN zones of the DNS Service.", + SerializedName = @"fqdnZones", + PossibleTypes = new [] { typeof(string) })] + public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// DNS Service log level. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS Service log level.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS Service log level.", + SerializedName = @"logLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + public string LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? null; set => _workloadNetworkDnsServiceBody.LogLevel = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDnsServiceBody.Revision ?? default(long); set => _workloadNetworkDnsServiceBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDnsServiceBody = this._workloadNetworkDnsServiceBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateDnsService' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreateDnsServiceViaIdentity(InputObject.Id, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DnsServiceId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DnsServiceId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreateDnsService(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DnsServiceId ?? null, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..1f4c4af5b35a --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,628 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a DNS service by id in a private cloud workload network. + /// + /// [OpenAPI] CreateDnsService=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a DNS service by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DNS Service + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Default DNS zone of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Default DNS zone of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default DNS zone of the DNS Service.", + SerializedName = @"defaultDnsZone", + PossibleTypes = new [] { typeof(string) })] + public string DefaultDnsZone { get => _workloadNetworkDnsServiceBody.DefaultDnsZone ?? null; set => _workloadNetworkDnsServiceBody.DefaultDnsZone = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DNS Service.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDnsServiceBody.DisplayName ?? null; set => _workloadNetworkDnsServiceBody.DisplayName = value; } + + /// DNS service IP of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS service IP of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS service IP of the DNS Service.", + SerializedName = @"dnsServiceIp", + PossibleTypes = new [] { typeof(string) })] + public string DnsServiceIP { get => _workloadNetworkDnsServiceBody.DnsServiceIP ?? null; set => _workloadNetworkDnsServiceBody.DnsServiceIP = value; } + + /// Backing field for property. + private string _dnsServiceName; + + /// + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DNS Service identifier. Generally the same as the DNS Service's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DNS Service identifier. Generally the same as the DNS Service's display name", + SerializedName = @"dnsServiceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// FQDN zones of the DNS Service. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "FQDN zones of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"FQDN zones of the DNS Service.", + SerializedName = @"fqdnZones", + PossibleTypes = new [] { typeof(string) })] + public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// DNS Service log level. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS Service log level.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS Service log level.", + SerializedName = @"logLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + public string LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? null; set => _workloadNetworkDnsServiceBody.LogLevel = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDnsServiceBody.Revision ?? default(long); set => _workloadNetworkDnsServiceBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDnsServiceBody = this._workloadNetworkDnsServiceBody; + clone.DnsServiceName = this.DnsServiceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateDnsService' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dnsServices/{(global::System.Uri.EscapeDataString(this.DnsServiceName.ToString()))}"; + await this.Client.WorkloadNetworksCreateDnsServiceViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreateDnsService(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DnsServiceName, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DnsServiceName=DnsServiceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded.cs index d5161ddee962..337e5db7e536 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create a DNS zone by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDnsZone_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: /// 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; + /// NSX DNS Zone - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -80,7 +100,7 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: Description = @"DNS Server IP array of the DNS Zone.", SerializedName = @"dnsServerIps", PossibleTypes = new [] { typeof(string) })] - public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP ?? null /* arrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = value; } + public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = (value != null ? new System.Collections.Generic.List(value) : null); } /// Number of DNS Services using the DNS zone. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of DNS Services using the DNS zone.")] @@ -117,7 +137,10 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: Description = @"Domain names of the DNS Zone.", SerializedName = @"domain", PossibleTypes = new [] { typeof(string) })] - public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain ?? null /* arrayOf */; set => _workloadNetworkDnsZoneBody.Domain = value; } + public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.Domain = (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")] @@ -153,7 +176,7 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -235,7 +258,8 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -244,24 +268,24 @@ public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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) @@ -309,7 +333,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -356,11 +384,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -372,10 +425,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -385,7 +454,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkDnsZone_CreateExpanded() { @@ -451,7 +520,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -464,12 +533,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreateDnsZone(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsZoneName, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreateDnsZone(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsZoneName, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DnsZoneName=DnsZoneName,body=_workloadNetworkDnsZoneBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DnsZoneName=DnsZoneName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -492,12 +561,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -514,15 +583,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsZoneName=DnsZoneName, body=_workloadNetworkDnsZoneBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsZoneName=DnsZoneName, body=_workloadNetworkDnsZoneBody }) + 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 } }); @@ -532,12 +601,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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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 ) { @@ -549,8 +618,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..64c9e235f156 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded.cs @@ -0,0 +1,613 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a DNS zone by id in a private cloud workload network. + /// + /// [OpenAPI] CreateDnsZone=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a DNS zone by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DNS Zone + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the DNS Zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DNS Zone.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDnsZoneBody.DisplayName ?? null; set => _workloadNetworkDnsZoneBody.DisplayName = value; } + + /// DNS Server IP array of the DNS Zone. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS Server IP array of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS Server IP array of the DNS Zone.", + SerializedName = @"dnsServerIps", + PossibleTypes = new [] { typeof(string) })] + public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Number of DNS Services using the DNS zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of DNS Services using the DNS zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of DNS Services using the DNS zone.", + SerializedName = @"dnsServices", + PossibleTypes = new [] { typeof(long) })] + public long DnsService { get => _workloadNetworkDnsZoneBody.DnsService ?? default(long); set => _workloadNetworkDnsZoneBody.DnsService = value; } + + /// Domain names of the DNS Zone. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Domain names of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Domain names of the DNS Zone.", + SerializedName = @"domain", + PossibleTypes = new [] { typeof(string) })] + public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.Domain = (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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDnsZoneBody.Revision ?? default(long); set => _workloadNetworkDnsZoneBody.Revision = value; } + + /// Source IP of the DNS Zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source IP of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source IP of the DNS Zone.", + SerializedName = @"sourceIp", + PossibleTypes = new [] { typeof(string) })] + public string SourceIP { get => _workloadNetworkDnsZoneBody.SourceIP ?? null; set => _workloadNetworkDnsZoneBody.SourceIP = 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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDnsZoneBody = this._workloadNetworkDnsZoneBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateDnsZone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreateDnsZoneViaIdentity(InputObject.Id, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DnsZoneId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DnsZoneId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreateDnsZone(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DnsZoneId ?? null, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..35791a6d7462 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,626 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a DNS zone by id in a private cloud workload network. + /// + /// [OpenAPI] CreateDnsZone=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a DNS zone by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DNS Zone + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the DNS Zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DNS Zone.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDnsZoneBody.DisplayName ?? null; set => _workloadNetworkDnsZoneBody.DisplayName = value; } + + /// DNS Server IP array of the DNS Zone. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS Server IP array of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS Server IP array of the DNS Zone.", + SerializedName = @"dnsServerIps", + PossibleTypes = new [] { typeof(string) })] + public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Number of DNS Services using the DNS zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of DNS Services using the DNS zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of DNS Services using the DNS zone.", + SerializedName = @"dnsServices", + PossibleTypes = new [] { typeof(long) })] + public long DnsService { get => _workloadNetworkDnsZoneBody.DnsService ?? default(long); set => _workloadNetworkDnsZoneBody.DnsService = value; } + + /// Backing field for property. + private string _dnsZoneName; + + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DNS Zone identifier. Generally the same as the DNS Zone's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DNS Zone identifier. Generally the same as the DNS Zone's display name", + SerializedName = @"dnsZoneId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DnsZoneName { get => this._dnsZoneName; set => this._dnsZoneName = value; } + + /// Domain names of the DNS Zone. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Domain names of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Domain names of the DNS Zone.", + SerializedName = @"domain", + PossibleTypes = new [] { typeof(string) })] + public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.Domain = (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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDnsZoneBody.Revision ?? default(long); set => _workloadNetworkDnsZoneBody.Revision = value; } + + /// Source IP of the DNS Zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source IP of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source IP of the DNS Zone.", + SerializedName = @"sourceIp", + PossibleTypes = new [] { typeof(string) })] + public string SourceIP { get => _workloadNetworkDnsZoneBody.SourceIP ?? null; set => _workloadNetworkDnsZoneBody.SourceIP = 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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDnsZoneBody = this._workloadNetworkDnsZoneBody; + clone.DnsZoneName = this.DnsZoneName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateDnsZone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dnsZones/{(global::System.Uri.EscapeDataString(this.DnsZoneName.ToString()))}"; + await this.Client.WorkloadNetworksCreateDnsZoneViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreateDnsZone(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DnsZoneName, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DnsZoneName=DnsZoneName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded.cs index 1c4e01ffc2dc..eca0a8f35f1d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create a port mirroring profile by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkPortMirroring_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl /// 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; + /// NSX Port Mirroring - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -78,9 +98,9 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl ReadOnly = false, Description = @"Direction of port mirroring profile.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum Direction { get => _workloadNetworkPortMirroringBody.Direction ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum)""); set => _workloadNetworkPortMirroringBody.Direction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + public string Direction { get => _workloadNetworkPortMirroringBody.Direction ?? null; set => _workloadNetworkPortMirroringBody.Direction = value; } /// Display name of the port mirroring profile. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the port mirroring profile.")] @@ -93,6 +113,9 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkPortMirroringBody.DisplayName ?? null; set => _workloadNetworkPortMirroringBody.DisplayName = 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] @@ -127,7 +150,7 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _portMirroringName; @@ -225,7 +248,8 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -234,24 +258,24 @@ public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded : gl /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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) @@ -299,7 +323,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -346,11 +374,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -362,10 +415,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -375,7 +444,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkPortMirroring_CreateExpanded() { @@ -441,7 +510,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -454,12 +523,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreatePortMirroring(SubscriptionId, ResourceGroupName, PrivateCloudName, PortMirroringName, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreatePortMirroring(SubscriptionId, ResourceGroupName, PrivateCloudName, PortMirroringName, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,PortMirroringName=PortMirroringName,body=_workloadNetworkPortMirroringBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,PortMirroringName=PortMirroringName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -482,12 +551,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -504,15 +573,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PortMirroringName=PortMirroringName, body=_workloadNetworkPortMirroringBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PortMirroringName=PortMirroringName, body=_workloadNetworkPortMirroringBody }) + 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 } }); @@ -522,12 +591,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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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 ) { @@ -539,8 +608,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..49f7db86e4ff --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded.cs @@ -0,0 +1,602 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a port mirroring profile by id in a private cloud workload network. + /// + /// [OpenAPI] CreatePortMirroring=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a port mirroring profile by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Port Mirroring + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Destination VM Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Destination VM Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Destination VM Group.", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + public string Destination { get => _workloadNetworkPortMirroringBody.Destination ?? null; set => _workloadNetworkPortMirroringBody.Destination = value; } + + /// Direction of port mirroring profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Direction of port mirroring profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Direction of port mirroring profile.", + SerializedName = @"direction", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + public string Direction { get => _workloadNetworkPortMirroringBody.Direction ?? null; set => _workloadNetworkPortMirroringBody.Direction = value; } + + /// Display name of the port mirroring profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the port mirroring profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the port mirroring profile.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkPortMirroringBody.DisplayName ?? null; set => _workloadNetworkPortMirroringBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkPortMirroringBody.Revision ?? default(long); set => _workloadNetworkPortMirroringBody.Revision = value; } + + /// Source VM Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source VM Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source VM Group.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string Source { get => _workloadNetworkPortMirroringBody.Source ?? null; set => _workloadNetworkPortMirroringBody.Source = 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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkPortMirroringBody = this._workloadNetworkPortMirroringBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreatePortMirroring' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreatePortMirroringViaIdentity(InputObject.Id, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PortMirroringId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PortMirroringId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreatePortMirroring(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.PortMirroringId ?? null, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..d86294f9ecc0 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,616 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a port mirroring profile by id in a private cloud workload network. + /// + /// [OpenAPI] CreatePortMirroring=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a port mirroring profile by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Port Mirroring + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Destination VM Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Destination VM Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Destination VM Group.", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + public string Destination { get => _workloadNetworkPortMirroringBody.Destination ?? null; set => _workloadNetworkPortMirroringBody.Destination = value; } + + /// Direction of port mirroring profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Direction of port mirroring profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Direction of port mirroring profile.", + SerializedName = @"direction", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + public string Direction { get => _workloadNetworkPortMirroringBody.Direction ?? null; set => _workloadNetworkPortMirroringBody.Direction = value; } + + /// Display name of the port mirroring profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the port mirroring profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the port mirroring profile.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkPortMirroringBody.DisplayName ?? null; set => _workloadNetworkPortMirroringBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _portMirroringName; + + /// + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name", + SerializedName = @"portMirroringId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PortMirroringName { get => this._portMirroringName; set => this._portMirroringName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkPortMirroringBody.Revision ?? default(long); set => _workloadNetworkPortMirroringBody.Revision = value; } + + /// Source VM Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source VM Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source VM Group.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string Source { get => _workloadNetworkPortMirroringBody.Source ?? null; set => _workloadNetworkPortMirroringBody.Source = 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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkPortMirroringBody = this._workloadNetworkPortMirroringBody; + clone.PortMirroringName = this.PortMirroringName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreatePortMirroring' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/portMirroringProfiles/{(global::System.Uri.EscapeDataString(this.PortMirroringName.ToString()))}"; + await this.Client.WorkloadNetworksCreatePortMirroringViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreatePortMirroring(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, PortMirroringName, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PortMirroringName=PortMirroringName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded.cs index c05562e1bef2..cc4a857d831a 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create a Public IP Block by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkPublicIP_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a Public IP Block by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global: /// 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; + /// NSX Public IP Block - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP _workloadNetworkPublicIPBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPublicIP(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP _workloadNetworkPublicIPBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -70,6 +90,9 @@ public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global: PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkPublicIPBody.DisplayName ?? null; set => _workloadNetworkPublicIPBody.DisplayName = 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] @@ -115,7 +138,7 @@ public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -191,7 +214,8 @@ public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -200,24 +224,24 @@ public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded : global: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP /// 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) @@ -265,7 +289,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -312,11 +340,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -328,10 +381,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -341,7 +410,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkPublicIP_CreateExpanded() { @@ -407,7 +476,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -420,12 +489,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreatePublicIP(SubscriptionId, ResourceGroupName, PrivateCloudName, PublicIPName, _workloadNetworkPublicIPBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreatePublicIP(SubscriptionId, ResourceGroupName, PrivateCloudName, PublicIPName, _workloadNetworkPublicIPBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,PublicIPName=PublicIPName,body=_workloadNetworkPublicIPBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,PublicIPName=PublicIPName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -448,12 +517,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -470,15 +539,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PublicIPName=PublicIPName, body=_workloadNetworkPublicIPBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PublicIPName=PublicIPName, body=_workloadNetworkPublicIPBody }) + 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 } }); @@ -488,12 +557,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.VMware.Models.Api20211201.IWorkloadNetworkPublicIP + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP /// 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 ) { @@ -505,8 +574,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..d3ef2ddc3810 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded.cs @@ -0,0 +1,567 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a Public IP Block by id in a private cloud workload network. + /// + /// [OpenAPI] CreatePublicIP=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a Public IP Block by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Public IP Block + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP _workloadNetworkPublicIPBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the Public IP Block. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the Public IP Block.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the Public IP Block.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkPublicIPBody.DisplayName ?? null; set => _workloadNetworkPublicIPBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Number of Public IPs requested. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of Public IPs requested.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of Public IPs requested.", + SerializedName = @"numberOfPublicIPs", + PossibleTypes = new [] { typeof(long) })] + public long NumberOfPublicIP { get => _workloadNetworkPublicIPBody.NumberOfPublicIP ?? default(long); set => _workloadNetworkPublicIPBody.NumberOfPublicIP = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkPublicIPBody = this._workloadNetworkPublicIPBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreatePublicIP' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreatePublicIPViaIdentity(InputObject.Id, _workloadNetworkPublicIPBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PublicIPId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PublicIPId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreatePublicIP(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.PublicIPId ?? null, _workloadNetworkPublicIPBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP + /// 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.VMware.Models.IWorkloadNetworkPublicIP + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..a8f5a667f3df --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,582 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a Public IP Block by id in a private cloud workload network. + /// + /// [OpenAPI] CreatePublicIP=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a Public IP Block by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Public IP Block + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP _workloadNetworkPublicIPBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPublicIP(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the Public IP Block. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the Public IP Block.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the Public IP Block.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkPublicIPBody.DisplayName ?? null; set => _workloadNetworkPublicIPBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Number of Public IPs requested. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of Public IPs requested.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of Public IPs requested.", + SerializedName = @"numberOfPublicIPs", + PossibleTypes = new [] { typeof(long) })] + public long NumberOfPublicIP { get => _workloadNetworkPublicIPBody.NumberOfPublicIP ?? default(long); set => _workloadNetworkPublicIPBody.NumberOfPublicIP = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _publicIPName; + + /// + /// NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Public IP Block identifier. Generally the same as the Public IP Block's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Public IP Block identifier. Generally the same as the Public IP Block's display name", + SerializedName = @"publicIPId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PublicIPName { get => this._publicIPName; set => this._publicIPName = 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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkPublicIPBody = this._workloadNetworkPublicIPBody; + clone.PublicIPName = this.PublicIPName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreatePublicIP' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/publicIPs/{(global::System.Uri.EscapeDataString(this.PublicIPName.ToString()))}"; + await this.Client.WorkloadNetworksCreatePublicIPViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkPublicIPBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreatePublicIP(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, PublicIPName, _workloadNetworkPublicIPBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PublicIPName=PublicIPName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPublicIP + /// 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.VMware.Models.IWorkloadNetworkPublicIP + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateExpanded.cs index b6b5208632f7..5d34007ea0bc 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create a segment by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkSegment_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: /// 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; + /// NSX Segment - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,9 +81,10 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: public string ConnectedGateway { get => _workloadNetworkSegmentBody.ConnectedGateway ?? null; set => _workloadNetworkSegmentBody.ConnectedGateway = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -81,6 +101,9 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkSegmentBody.DisplayName ?? null; set => _workloadNetworkSegmentBody.DisplayName = 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] @@ -115,7 +138,7 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -196,7 +219,7 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: Description = @"DHCP Range assigned for subnet.", SerializedName = @"dhcpRanges", PossibleTypes = new [] { typeof(string) })] - public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange ?? null /* arrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = value; } + public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = (value != null ? new System.Collections.Generic.List(value) : null); } /// Gateway address. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway address.")] @@ -223,7 +246,8 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -232,24 +256,24 @@ public partial class NewAzVMwareWorkloadNetworkSegment_CreateExpanded : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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) @@ -297,7 +321,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -344,11 +372,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -360,10 +413,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -373,7 +442,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkSegment_CreateExpanded() { @@ -439,7 +508,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -452,12 +521,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreateSegments(SubscriptionId, ResourceGroupName, PrivateCloudName, SegmentName, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreateSegments(SubscriptionId, ResourceGroupName, PrivateCloudName, SegmentName, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName,body=_workloadNetworkSegmentBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -480,12 +549,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -502,15 +571,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName, body=_workloadNetworkSegmentBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName, body=_workloadNetworkSegmentBody }) + 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 } }); @@ -520,12 +589,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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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 ) { @@ -537,8 +606,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..f769d7fe868e --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded.cs @@ -0,0 +1,601 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a segment by id in a private cloud workload network. + /// + /// [OpenAPI] CreateSegments=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a segment by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Segment + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Gateway which to connect segment to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway which to connect segment to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway which to connect segment to.", + SerializedName = @"connectedGateway", + PossibleTypes = new [] { typeof(string) })] + public string ConnectedGateway { get => _workloadNetworkSegmentBody.ConnectedGateway ?? null; set => _workloadNetworkSegmentBody.ConnectedGateway = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the segment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the segment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the segment.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkSegmentBody.DisplayName ?? null; set => _workloadNetworkSegmentBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkSegmentBody.Revision ?? default(long); set => _workloadNetworkSegmentBody.Revision = value; } + + /// DHCP Range assigned for subnet. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DHCP Range assigned for subnet.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DHCP Range assigned for subnet.", + SerializedName = @"dhcpRanges", + PossibleTypes = new [] { typeof(string) })] + public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Gateway address. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway address.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway address.", + SerializedName = @"gatewayAddress", + PossibleTypes = new [] { typeof(string) })] + public string SubnetGatewayAddress { get => _workloadNetworkSegmentBody.SubnetGatewayAddress ?? null; set => _workloadNetworkSegmentBody.SubnetGatewayAddress = 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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkSegmentBody = this._workloadNetworkSegmentBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateSegments' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreateSegmentsViaIdentity(InputObject.Id, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SegmentId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SegmentId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreateSegments(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.SegmentId ?? null, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..fdf9788786da --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,614 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a segment by id in a private cloud workload network. + /// + /// [OpenAPI] CreateSegments=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a segment by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Segment + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Gateway which to connect segment to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway which to connect segment to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway which to connect segment to.", + SerializedName = @"connectedGateway", + PossibleTypes = new [] { typeof(string) })] + public string ConnectedGateway { get => _workloadNetworkSegmentBody.ConnectedGateway ?? null; set => _workloadNetworkSegmentBody.ConnectedGateway = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the segment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the segment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the segment.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkSegmentBody.DisplayName ?? null; set => _workloadNetworkSegmentBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkSegmentBody.Revision ?? default(long); set => _workloadNetworkSegmentBody.Revision = value; } + + /// Backing field for property. + private string _segmentName; + + /// NSX Segment identifier. Generally the same as the Segment's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Segment identifier. Generally the same as the Segment's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Segment identifier. Generally the same as the Segment's display name", + SerializedName = @"segmentId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string SegmentName { get => this._segmentName; set => this._segmentName = value; } + + /// DHCP Range assigned for subnet. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DHCP Range assigned for subnet.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DHCP Range assigned for subnet.", + SerializedName = @"dhcpRanges", + PossibleTypes = new [] { typeof(string) })] + public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Gateway address. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway address.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway address.", + SerializedName = @"gatewayAddress", + PossibleTypes = new [] { typeof(string) })] + public string SubnetGatewayAddress { get => _workloadNetworkSegmentBody.SubnetGatewayAddress ?? null; set => _workloadNetworkSegmentBody.SubnetGatewayAddress = 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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkSegmentBody = this._workloadNetworkSegmentBody; + clone.SegmentName = this.SegmentName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateSegments' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/segments/{(global::System.Uri.EscapeDataString(this.SegmentName.ToString()))}"; + await this.Client.WorkloadNetworksCreateSegmentsViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreateSegments(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, SegmentName, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SegmentName=SegmentName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded.cs index f7e7dc175cb7..7781e648f5d6 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Create a vm group by id in a private cloud workload network. @@ -14,11 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkVMGroup_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: /// 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; + /// NSX VM Group - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -70,6 +90,9 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkVMGroupBody.DisplayName ?? null; set => _workloadNetworkVMGroupBody.DisplayName = 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] @@ -95,7 +118,7 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: Description = @"Virtual machine members of this group.", SerializedName = @"members", PossibleTypes = new [] { typeof(string) })] - public string[] Member { get => _workloadNetworkVMGroupBody.Member ?? null /* arrayOf */; set => _workloadNetworkVMGroupBody.Member = value; } + public string[] Member { get => _workloadNetworkVMGroupBody.Member?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkVMGroupBody.Member = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -116,7 +139,7 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -187,7 +210,8 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -210,24 +234,24 @@ public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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) @@ -275,7 +299,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetw /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -322,11 +350,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -338,10 +391,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -351,7 +420,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzVMwareWorkloadNetworkVMGroup_CreateExpanded() { @@ -417,7 +486,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -430,12 +499,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksCreateVMGroup(SubscriptionId, ResourceGroupName, PrivateCloudName, VMGroupName, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksCreateVMGroup(SubscriptionId, ResourceGroupName, PrivateCloudName, VMGroupName, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,VMGroupName=VMGroupName,body=_workloadNetworkVMGroupBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,VMGroupName=VMGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -458,12 +527,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -480,15 +549,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VMGroupName=VMGroupName, body=_workloadNetworkVMGroupBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VMGroupName=VMGroupName, body=_workloadNetworkVMGroupBody }) + 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 } }); @@ -498,12 +567,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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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 ) { @@ -515,8 +584,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded.cs new file mode 100644 index 000000000000..1a34d6dcdfb0 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded.cs @@ -0,0 +1,579 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a vm group by id in a private cloud workload network. + /// + /// [OpenAPI] CreateVMGroup=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a vm group by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX VM Group + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the VM group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the VM group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the VM group.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkVMGroupBody.DisplayName ?? null; set => _workloadNetworkVMGroupBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Virtual machine members of this group. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Virtual machine members of this group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Virtual machine members of this group.", + SerializedName = @"members", + PossibleTypes = new [] { typeof(string) })] + public string[] Member { get => _workloadNetworkVMGroupBody.Member?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkVMGroupBody.Member = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkVMGroupBody.Revision ?? default(long); set => _workloadNetworkVMGroupBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkVMGroupBody = this._workloadNetworkVMGroupBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateVMGroup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.WorkloadNetworksCreateVMGroupViaIdentity(InputObject.Id, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.VMGroupId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VMGroupId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.WorkloadNetworksCreateVMGroup(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.VMGroupId ?? null, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..5d1de0cfe1ad --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,592 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a vm group by id in a private cloud workload network. + /// + /// [OpenAPI] CreateVMGroup=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a vm group by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] + public partial class NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX VM Group + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the VM group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the VM group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the VM group.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkVMGroupBody.DisplayName ?? null; set => _workloadNetworkVMGroupBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// Virtual machine members of this group. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Virtual machine members of this group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Virtual machine members of this group.", + SerializedName = @"members", + PossibleTypes = new [] { typeof(string) })] + public string[] Member { get => _workloadNetworkVMGroupBody.Member?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkVMGroupBody.Member = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkVMGroupBody.Revision ?? default(long); set => _workloadNetworkVMGroupBody.Revision = value; } + + /// Backing field for property. + private string _vMGroupName; + + /// NSX VM Group identifier. Generally the same as the VM Group's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX VM Group identifier. Generally the same as the VM Group's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX VM Group identifier. Generally the same as the VM Group's display name", + SerializedName = @"vmGroupId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string VMGroupName { get => this._vMGroupName; set => this._vMGroupName = 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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkVMGroupBody = this._workloadNetworkVMGroupBody; + clone.VMGroupName = this.VMGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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 NewAzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksCreateVMGroup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/vmGroups/{(global::System.Uri.EscapeDataString(this.VMGroupName.ToString()))}"; + await this.Client.WorkloadNetworksCreateVMGroupViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksCreateVMGroup(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, VMGroupName, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VMGroupName=VMGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_Delete.cs index 0091f22cdcbb..5f7889c92ffe 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a addon in a private cloud @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a addon in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareAddon_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareAddon_Delete : global::System.Management.Auto /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareAddon_Delete : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -112,7 +135,7 @@ public partial class RemoveAzVMwareAddon_Delete : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -172,7 +195,8 @@ public partial class RemoveAzVMwareAddon_Delete : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -181,12 +205,12 @@ public partial class RemoveAzVMwareAddon_Delete : global::System.Management.Auto /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -253,7 +277,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareAddon_Del /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -300,11 +328,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -316,10 +369,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -387,7 +456,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -405,7 +474,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -418,7 +487,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareAddon_Delete() { @@ -436,12 +505,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -458,15 +527,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentity.cs index 5763276af5c1..2c9af1c028ab 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a addon in a private cloud @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a addon in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareAddon_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareAddon_DeleteViaIdentity : global::System.Mana /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareAddon_DeleteViaIdentity : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareAddon_DeleteViaIdentity : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareAddon_DeleteViaIdentity : global::System.Mana /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareAddon_Del /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareAddon_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..c25306504e66 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,573 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a addon in a private cloud + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareAddon_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a addon in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the addon for the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the addon for the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the addon for the private cloud", + SerializedName = @"addonName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AddonName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AddonsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/addons/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AddonsDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.AddonsDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareAddon_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_Delete.cs index 8582cbf23c41..69dfdc0ed143 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete an ExpressRoute Circuit Authorization in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete an ExpressRoute Circuit Authorization in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareAuthorization_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareAuthorization_Delete : 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareAuthorization_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -111,7 +134,7 @@ public partial class RemoveAzVMwareAuthorization_Delete : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareAuthorization_Delete : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareAuthorization_Delete : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareAuthoriza /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareAuthorization_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentity.cs index f9f09a8c3c48..cc33bc467f0d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete an ExpressRoute Circuit Authorization in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete an ExpressRoute Circuit Authorization in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareAuthorization_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareAuthorization_DeleteViaIdentity : global::Sys /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareAuthorization_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class RemoveAzVMwareAuthorization_DeleteViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class RemoveAzVMwareAuthorization_DeleteViaIdentity : global::Sys /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -195,7 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareAuthoriza /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -242,11 +269,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -258,10 +310,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -371,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -384,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareAuthorization_DeleteViaIdentity() { @@ -402,12 +470,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -424,7 +492,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..1b3929ee7bec --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,574 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete an ExpressRoute Circuit Authorization in a private cloud + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareAuthorization_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete an ExpressRoute Circuit Authorization in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the ExpressRoute Circuit Authorization in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the ExpressRoute Circuit Authorization in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the ExpressRoute Circuit Authorization in the private cloud", + SerializedName = @"authorizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AuthorizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AuthorizationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/authorizations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AuthorizationsDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.AuthorizationsDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareAuthorization_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_Delete.cs index 33e7ec711582..88c89724c969 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a cloud link in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a cloud link in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareCloudLink_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareCloudLink_Delete : 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareCloudLink_Delete : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -111,7 +134,7 @@ public partial class RemoveAzVMwareCloudLink_Delete : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareCloudLink_Delete : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareCloudLink_Delete : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareCloudLink /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareCloudLink_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentity.cs index 725bc01ee315..5a01ffb24466 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a cloud link in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a cloud link in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareCloudLink_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareCloudLink_DeleteViaIdentity : global::System. /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareCloudLink_DeleteViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class RemoveAzVMwareCloudLink_DeleteViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class RemoveAzVMwareCloudLink_DeleteViaIdentity : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -195,7 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareCloudLink /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -242,11 +269,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -258,10 +310,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -371,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -384,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareCloudLink_DeleteViaIdentity() { @@ -402,12 +470,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -424,7 +492,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..adb9824ffd5c --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,572 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a cloud link in a private cloud + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareCloudLink_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a cloud link in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cloud link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cloud link resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cloud link resource", + SerializedName = @"cloudLinkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudLinkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudLinksDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/cloudLinks/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.CloudLinksDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.CloudLinksDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareCloudLink_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_Delete.cs index 9cb8e3ab629e..b023feac19f0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a cluster in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a cluster in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareCluster_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareCluster_Delete : global::System.Management.Au /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareCluster_Delete : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -111,7 +134,7 @@ public partial class RemoveAzVMwareCluster_Delete : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareCluster_Delete : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareCluster_Delete : global::System.Management.Au /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareCluster_D /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareCluster_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentity.cs index ea49b822c48c..868173d70b8f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a cluster in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a cluster in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareCluster_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareCluster_DeleteViaIdentity : global::System.Ma /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareCluster_DeleteViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class RemoveAzVMwareCluster_DeleteViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class RemoveAzVMwareCluster_DeleteViaIdentity : global::System.Ma /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -195,7 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareCluster_D /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -242,11 +269,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -258,10 +310,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -371,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -384,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareCluster_DeleteViaIdentity() { @@ -402,12 +470,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -424,7 +492,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..81640fcc5854 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,572 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a cluster in a private cloud + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareCluster_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a cluster in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ClustersDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ClustersDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareCluster_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_Delete.cs index 33bd32a5f73c..d05ee7bebbf0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a datastore in a private cloud cluster @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a datastore in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareDatastore_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareDatastore_Delete : 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,6 +59,9 @@ public partial class RemoveAzVMwareDatastore_Delete : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -61,14 +80,18 @@ public partial class RemoveAzVMwareDatastore_Delete : global::System.Management. public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -125,7 +148,7 @@ public partial class RemoveAzVMwareDatastore_Delete : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -185,7 +208,8 @@ public partial class RemoveAzVMwareDatastore_Delete : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -194,12 +218,12 @@ public partial class RemoveAzVMwareDatastore_Delete : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -267,7 +291,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareDatastore /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -314,11 +342,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -330,10 +383,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -401,7 +470,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -419,7 +488,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -432,7 +501,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareDatastore_Delete() { @@ -450,12 +519,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -472,15 +541,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentity.cs index db3dfc4f775a..b04a91986f08 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a datastore in a private cloud cluster @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a datastore in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareDatastore_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareDatastore_DeleteViaIdentity : global::System. /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareDatastore_DeleteViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class RemoveAzVMwareDatastore_DeleteViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class RemoveAzVMwareDatastore_DeleteViaIdentity : global::System. /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -195,7 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareDatastore /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -242,11 +269,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -258,10 +310,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -375,7 +443,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,7 +456,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareDatastore_DeleteViaIdentity() { @@ -406,12 +474,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -428,7 +496,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentityCluster.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentityCluster.cs new file mode 100644 index 000000000000..172a8ac258a6 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentityCluster.cs @@ -0,0 +1,576 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a datastore in a private cloud cluster + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareDatastore_DeleteViaIdentityCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareDatastore_DeleteViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzVMwareDatastore_DeleteViaIdentityCluster + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareDatastore_DeleteViaIdentityCluster Clone() + { + var clone = new RemoveAzVMwareDatastore_DeleteViaIdentityCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DatastoresDeleteViaIdentity(ClusterInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.DatastoresDelete(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareDatastore_DeleteViaIdentityCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..7ed468d6e127 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,587 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a datastore in a private cloud cluster + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareDatastore_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.DatastoresDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.DatastoresDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareDatastore_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_Delete.cs index 8d87025e3f29..cbe9e8684853 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a global reach connection in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a global reach connection in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareGlobalReachConnection_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareGlobalReachConnection_Delete : global::System /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareGlobalReachConnection_Delete : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -111,7 +134,7 @@ public partial class RemoveAzVMwareGlobalReachConnection_Delete : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareGlobalReachConnection_Delete : global::System [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareGlobalReachConnection_Delete : global::System /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareGlobalRea /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareGlobalReachConnection_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity.cs index 0ca93f169807..79199aae6fd9 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a global reach connection in a private cloud @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a global reach connection in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity : glo /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity : glo /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -195,7 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareGlobalRea /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -242,11 +269,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -258,10 +310,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -371,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -384,7 +452,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareGlobalReachConnection_DeleteViaIdentity() { @@ -402,12 +470,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -424,7 +492,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..df36e4006adb --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a global reach connection in a private cloud + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a global reach connection in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the global reach connection in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the global reach connection in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the global reach connection in the private cloud", + SerializedName = @"globalReachConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GlobalReachConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GlobalReachConnectionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/globalReachConnections/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.GlobalReachConnectionsDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.GlobalReachConnectionsDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareGlobalReachConnection_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_Delete.cs index b06fd92fd09e..59f348cddcdf 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a placement policy in a private cloud cluster @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a placement policy in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Manag /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,6 +59,9 @@ public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -61,14 +80,18 @@ public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Manag public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -127,7 +150,7 @@ public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -187,7 +210,8 @@ public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -196,12 +220,12 @@ public partial class RemoveAzVMwarePlacementPolicy_Delete : global::System.Manag /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -269,7 +293,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwarePlacement /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -316,11 +344,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -332,10 +385,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -403,7 +472,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -421,7 +490,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -434,7 +503,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwarePlacementPolicy_Delete() { @@ -452,12 +521,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -474,15 +543,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentity.cs index a8dbf6dba453..3c1b67b83700 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a placement policy in a private cloud cluster @@ -16,8 +18,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a placement policy in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,6 +37,18 @@ public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentity : global::S /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -43,18 +59,25 @@ public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -104,7 +127,7 @@ public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -127,12 +150,12 @@ public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentity : global::S /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -195,7 +218,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwarePlacement /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -242,11 +269,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -258,10 +310,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +397,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -375,7 +443,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,7 +456,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwarePlacementPolicy_DeleteViaIdentity() { @@ -406,12 +474,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -428,7 +496,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster.cs new file mode 100644 index 000000000000..414e80fa1aaf --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster.cs @@ -0,0 +1,578 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a placement policy in a private cloud cluster + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwarePlacementPolicy_DeleteViaIdentityCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster Clone() + { + var clone = new RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesDeleteViaIdentity(ClusterInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.PlacementPoliciesDelete(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwarePlacementPolicy_DeleteViaIdentityCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..9453e5e45ebc --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,591 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a placement policy in a private cloud cluster + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.PlacementPoliciesDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwarePlacementPolicy_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_Delete.cs index 085e03b1a614..14546a11925c 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a private cloud @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwarePrivateCloud_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwarePrivateCloud_Delete : global::System.Manageme /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwarePrivateCloud_Delete : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -112,7 +135,7 @@ public partial class RemoveAzVMwarePrivateCloud_Delete : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -158,7 +181,8 @@ public partial class RemoveAzVMwarePrivateCloud_Delete : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -167,12 +191,12 @@ public partial class RemoveAzVMwarePrivateCloud_Delete : global::System.Manageme /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -238,7 +262,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwarePrivateCl /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -285,11 +313,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -301,10 +354,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -372,7 +441,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -390,7 +459,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -403,7 +472,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwarePrivateCloud_Delete() { @@ -421,12 +490,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -443,15 +512,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_DeleteViaIdentity.cs index 894ad387c5bd..bedda032818a 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwarePrivateCloud_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a private cloud @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwarePrivateCloud_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwarePrivateCloud_DeleteViaIdentity : global::Syst /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwarePrivateCloud_DeleteViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwarePrivateCloud_DeleteViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwarePrivateCloud_DeleteViaIdentity : global::Syst /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwarePrivateCl /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -368,7 +436,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,7 +449,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwarePrivateCloud_DeleteViaIdentity() { @@ -399,12 +467,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -421,7 +489,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_Delete.cs index f4ee533a681a..4a316b90fade 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Cancel a ScriptExecution in a private cloud @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Cancel a ScriptExecution in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareScriptExecution_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareScriptExecution_Delete : global::System.Manag /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareScriptExecution_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -112,7 +135,7 @@ public partial class RemoveAzVMwareScriptExecution_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -172,7 +195,8 @@ public partial class RemoveAzVMwareScriptExecution_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -181,12 +205,12 @@ public partial class RemoveAzVMwareScriptExecution_Delete : global::System.Manag /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -253,7 +277,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareScriptExe /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -300,11 +328,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -316,10 +369,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -387,7 +456,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -405,7 +474,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -418,7 +487,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareScriptExecution_Delete() { @@ -436,12 +505,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -458,15 +527,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentity.cs index 78870d0a935e..fbbc7d0ec30e 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Cancel a ScriptExecution in a private cloud @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Cancel a ScriptExecution in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareScriptExecution_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareScriptExecution_DeleteViaIdentity : global::S /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareScriptExecution_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareScriptExecution_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareScriptExecution_DeleteViaIdentity : global::S /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareScriptExe /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareScriptExecution_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..aa2527877b69 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Cancel a ScriptExecution in a private cloud + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareScriptExecution_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Cancel a ScriptExecution in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/scriptExecutions/{scriptExecutionName}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the user-invoked script execution resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the user-invoked script execution resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the user-invoked script execution resource", + SerializedName = @"scriptExecutionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ScriptExecutionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ScriptExecutionsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/scriptExecutions/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ScriptExecutionsDeleteViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ScriptExecutionsDelete(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareScriptExecution_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_Delete.cs index 6424525d006e..a7c87e26780e 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete dhcp by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,13 +60,17 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -70,6 +90,9 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DhcpName { get => this._dhcpName; set => this._dhcpName = 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] @@ -111,7 +134,7 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : global::System.M [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_Delete : 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DhcpName=DhcpName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DhcpName=DhcpName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkDhcp_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DhcpName=DhcpName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DhcpName=DhcpName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity.cs index 4b8b3c3644ae..0ee0449fca48 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete dhcp by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity : globa /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..e8e82e77a268 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete dhcp by id in a private cloud workload network. + /// + /// [OpenAPI] DeleteDhcp=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete dhcp by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _dhcpName; + + /// NSX DHCP identifier. Generally the same as the DHCP display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DHCP identifier. Generally the same as the DHCP display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DHCP identifier. Generally the same as the DHCP display name", + SerializedName = @"dhcpId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DhcpName { get => this._dhcpName; set => this._dhcpName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.DhcpName = this.DhcpName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeleteDhcp' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dhcpConfigurations/{(global::System.Uri.EscapeDataString(this.DhcpName.ToString()))}"; + await this.Client.WorkloadNetworksDeleteDhcpViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksDeleteDhcp(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DhcpName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DhcpName=DhcpName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_Delete.cs index f415732a054d..71fa5228d42b 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a DNS service by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::Sy /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,13 +60,17 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -72,6 +92,9 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = 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] @@ -113,7 +136,7 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -173,7 +196,8 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +206,12 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_Delete : global::Sy /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -254,7 +278,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -301,11 +329,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -317,10 +370,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -388,7 +457,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,DnsServiceName=DnsServiceName,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DnsServiceName=DnsServiceName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -419,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkDnsService_Delete() { @@ -437,12 +506,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -459,15 +528,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DnsServiceName=DnsServiceName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DnsServiceName=DnsServiceName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity.cs index 01e89827252c..7860f35283e1 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a DNS service by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity : /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity : /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -198,7 +221,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -245,11 +272,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -261,10 +313,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -332,7 +400,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,7 +442,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,7 +455,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentity() { @@ -405,12 +473,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -427,7 +495,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService.cs new file mode 100644 index 000000000000..23700f69bd55 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a DNS service by id in a private cloud workload network. + /// + /// [OpenAPI] DeleteDnsService=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a DNS service by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _dnsServiceInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity DnsServiceInputObject { get => this._dnsServiceInputObject; set => this._dnsServiceInputObject = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PrivateCloudName = this.PrivateCloudName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeleteDnsService' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (DnsServiceInputObject?.Id != null) + { + this.DnsServiceInputObject.Id += $"/privateClouds/{(global::System.Uri.EscapeDataString(this.PrivateCloudName.ToString()))}"; + await this.Client.WorkloadNetworksDeleteDnsServiceViaIdentity(DnsServiceInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == DnsServiceInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DnsServiceInputObject has null value for DnsServiceInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DnsServiceInputObject) ); + } + if (null == DnsServiceInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DnsServiceInputObject has null value for DnsServiceInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DnsServiceInputObject) ); + } + if (null == DnsServiceInputObject.DnsServiceId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DnsServiceInputObject has null value for DnsServiceInputObject.DnsServiceId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DnsServiceInputObject) ); + } + await this.Client.WorkloadNetworksDeleteDnsService(DnsServiceInputObject.SubscriptionId ?? null, DnsServiceInputObject.ResourceGroupName ?? null, DnsServiceInputObject.DnsServiceId ?? null, PrivateCloudName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_Delete.cs index 94ff722d434e..102569f7d53d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a DNS zone by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::Syste /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,13 +60,17 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -70,6 +90,9 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DnsZoneName { get => this._dnsZoneName; set => this._dnsZoneName = 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] @@ -111,7 +134,7 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_Delete : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,DnsZoneName=DnsZoneName,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,DnsZoneName=DnsZoneName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkDnsZone_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DnsZoneName=DnsZoneName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, DnsZoneName=DnsZoneName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity.cs index ab5f6d03d57e..20bf810dedb1 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a DNS zone by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity : gl /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity : gl /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone.cs new file mode 100644 index 000000000000..52dd76276675 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a DNS zone by id in a private cloud workload network. + /// + /// [OpenAPI] DeleteDnsZone=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a DNS zone by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _dnsZoneInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity DnsZoneInputObject { get => this._dnsZoneInputObject; set => this._dnsZoneInputObject = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PrivateCloudName = this.PrivateCloudName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeleteDnsZone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (DnsZoneInputObject?.Id != null) + { + this.DnsZoneInputObject.Id += $"/privateClouds/{(global::System.Uri.EscapeDataString(this.PrivateCloudName.ToString()))}"; + await this.Client.WorkloadNetworksDeleteDnsZoneViaIdentity(DnsZoneInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == DnsZoneInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DnsZoneInputObject has null value for DnsZoneInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DnsZoneInputObject) ); + } + if (null == DnsZoneInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DnsZoneInputObject has null value for DnsZoneInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DnsZoneInputObject) ); + } + if (null == DnsZoneInputObject.DnsZoneId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("DnsZoneInputObject has null value for DnsZoneInputObject.DnsZoneId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, DnsZoneInputObject) ); + } + await this.Client.WorkloadNetworksDeleteDnsZone(DnsZoneInputObject.SubscriptionId ?? null, DnsZoneInputObject.ResourceGroupName ?? null, DnsZoneInputObject.DnsZoneId ?? null, PrivateCloudName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_Delete.cs index 527c3b7d887f..bea2d9d0646d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a port mirroring profile by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_Delete : global: /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_Delete : global: [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -97,7 +120,7 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_Delete : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _portMirroringName; @@ -173,7 +196,8 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_Delete : global: [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +206,12 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_Delete : global: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -254,7 +278,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -301,11 +329,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -317,10 +370,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -388,7 +457,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PortMirroringName=PortMirroringName,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PortMirroringName=PortMirroringName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -419,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkPortMirroring_Delete() { @@ -437,12 +506,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -459,15 +528,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PortMirroringName=PortMirroringName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PortMirroringName=PortMirroringName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity.cs index 4fd548031e2c..66d63ccc6db9 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a port mirroring profile by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentit /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentit /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -198,7 +221,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -245,11 +272,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -261,10 +313,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -332,7 +400,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,7 +442,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -387,7 +455,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity() { @@ -405,12 +473,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -427,7 +495,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile.cs new file mode 100644 index 000000000000..94e4d703d0eb --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a port mirroring profile by id in a private cloud workload network. + /// + /// [OpenAPI] DeletePortMirroring=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a port mirroring profile by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _portMirroringProfileInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PortMirroringProfileInputObject { get => this._portMirroringProfileInputObject; set => this._portMirroringProfileInputObject = value; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PrivateCloudName = this.PrivateCloudName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeletePortMirroring' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PortMirroringProfileInputObject?.Id != null) + { + this.PortMirroringProfileInputObject.Id += $"/privateClouds/{(global::System.Uri.EscapeDataString(this.PrivateCloudName.ToString()))}"; + await this.Client.WorkloadNetworksDeletePortMirroringViaIdentity(PortMirroringProfileInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PortMirroringProfileInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PortMirroringProfileInputObject has null value for PortMirroringProfileInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PortMirroringProfileInputObject) ); + } + if (null == PortMirroringProfileInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PortMirroringProfileInputObject has null value for PortMirroringProfileInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PortMirroringProfileInputObject) ); + } + if (null == PortMirroringProfileInputObject.PortMirroringId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PortMirroringProfileInputObject has null value for PortMirroringProfileInputObject.PortMirroringId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PortMirroringProfileInputObject) ); + } + await this.Client.WorkloadNetworksDeletePortMirroring(PortMirroringProfileInputObject.SubscriptionId ?? null, PortMirroringProfileInputObject.ResourceGroupName ?? null, PortMirroringProfileInputObject.PortMirroringId ?? null, PrivateCloudName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_Delete.cs index 8ea064f8710f..abeebdf85b6c 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a Public IP Block by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a Public IP Block by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkPublicIP_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_Delete : global::Syst /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_Delete : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -97,7 +120,7 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_Delete : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -173,7 +196,8 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_Delete : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,12 +206,12 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_Delete : global::Syst /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -254,7 +278,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -301,11 +329,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -317,10 +370,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -388,7 +457,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PublicIPName=PublicIPName,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PublicIPName=PublicIPName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -419,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkPublicIP_Delete() { @@ -437,12 +506,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -459,15 +528,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PublicIPName=PublicIPName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PublicIPName=PublicIPName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity.cs index b95af9900c23..aebedc8cc615 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a Public IP Block by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a Public IP Block by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity : g /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity : g /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP.cs new file mode 100644 index 000000000000..2240034bb021 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a Public IP Block by id in a private cloud workload network. + /// + /// [OpenAPI] DeletePublicIP=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a Public IP Block by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/publicIPs/{publicIPId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _publicIPInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PublicIPInputObject { get => this._publicIPInputObject; set => this._publicIPInputObject = 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PrivateCloudName = this.PrivateCloudName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeletePublicIP' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PublicIPInputObject?.Id != null) + { + this.PublicIPInputObject.Id += $"/privateClouds/{(global::System.Uri.EscapeDataString(this.PrivateCloudName.ToString()))}"; + await this.Client.WorkloadNetworksDeletePublicIPViaIdentity(PublicIPInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PublicIPInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PublicIPInputObject has null value for PublicIPInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PublicIPInputObject) ); + } + if (null == PublicIPInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PublicIPInputObject has null value for PublicIPInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PublicIPInputObject) ); + } + if (null == PublicIPInputObject.PublicIPId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PublicIPInputObject has null value for PublicIPInputObject.PublicIPId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PublicIPInputObject) ); + } + await this.Client.WorkloadNetworksDeletePublicIP(PublicIPInputObject.SubscriptionId ?? null, PublicIPInputObject.ResourceGroupName ?? null, PublicIPInputObject.PublicIPId ?? null, PrivateCloudName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_Delete.cs index 68b4ce8ecf14..eaee00908352 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a segment by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkSegment_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_Delete : global::Syste /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_Delete : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -97,7 +120,7 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_Delete : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -171,7 +194,8 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_Delete : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_Delete : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkSegment_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity.cs index c4c850c32069..ace4dcc50ab0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a segment by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity : gl /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity : gl /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud.cs new file mode 100644 index 000000000000..88d075ffa7ba --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a segment by id in a private cloud workload network. + /// + /// [OpenAPI] DeleteSegment=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a segment by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _segmentName; + + /// NSX Segment identifier. Generally the same as the Segment's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Segment identifier. Generally the same as the Segment's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Segment identifier. Generally the same as the Segment's display name", + SerializedName = @"segmentId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string SegmentName { get => this._segmentName; set => this._segmentName = 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SegmentName = this.SegmentName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeleteSegment' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/segments/{(global::System.Uri.EscapeDataString(this.SegmentName.ToString()))}"; + await this.Client.WorkloadNetworksDeleteSegmentViaIdentity(PrivateCloudInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksDeleteSegment(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, SegmentName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SegmentName=SegmentName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_Delete.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_Delete.cs index 66b89d78e6e8..ccbbaaf85080 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_Delete.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a vm group by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkVMGroup_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_Delete : global::Syste /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_Delete : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -97,7 +120,7 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_Delete : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -157,7 +180,8 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_Delete : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -180,12 +204,12 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_Delete : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -252,7 +276,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -299,11 +327,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +368,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +455,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +473,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,VMGroupName=VMGroupName,PrivateCloudName=PrivateCloudName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,VMGroupName=VMGroupName,PrivateCloudName=PrivateCloudName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +486,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkVMGroup_Delete() { @@ -435,12 +504,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -457,15 +526,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.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, VMGroupName=VMGroupName, PrivateCloudName=PrivateCloudName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, VMGroupName=VMGroupName, PrivateCloudName=PrivateCloudName }) + 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/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity.cs index d210f0a15440..97eac622bb89 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Delete a vm group by id in a private cloud workload network. @@ -17,8 +19,10 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +38,18 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity : gl /// 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; + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] @@ -44,18 +60,25 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -105,7 +128,7 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -128,12 +151,12 @@ public partial class RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity : gl /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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); /// /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of @@ -196,7 +219,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -243,11 +270,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -259,10 +311,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +398,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -372,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -385,7 +453,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity() { @@ -403,12 +471,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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -425,7 +493,7 @@ 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.VMware.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 } diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup.cs b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup.cs new file mode 100644 index 000000000000..4bfba194831d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup.cs @@ -0,0 +1,575 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Delete a vm group by id in a private cloud workload network. + /// + /// [OpenAPI] DeleteVMGroup=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Delete a vm group by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] + public partial class RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _vMGroupInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity VMGroupInputObject { get => this._vMGroupInputObject; set => this._vMGroupInputObject = 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.VMware.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent 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. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, 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. + /// /// 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, 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup Clone() + { + var clone = new RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.PrivateCloudName = this.PrivateCloudName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksDeleteVMGroup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (VMGroupInputObject?.Id != null) + { + this.VMGroupInputObject.Id += $"/privateClouds/{(global::System.Uri.EscapeDataString(this.PrivateCloudName.ToString()))}"; + await this.Client.WorkloadNetworksDeleteVMGroupViaIdentity(VMGroupInputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == VMGroupInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VMGroupInputObject has null value for VMGroupInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VMGroupInputObject) ); + } + if (null == VMGroupInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VMGroupInputObject has null value for VMGroupInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VMGroupInputObject) ); + } + if (null == VMGroupInputObject.VMGroupId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VMGroupInputObject has null value for VMGroupInputObject.VMGroupId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VMGroupInputObject) ); + } + await this.Client.WorkloadNetworksDeleteVMGroup(VMGroupInputObject.SubscriptionId ?? null, VMGroupInputObject.ResourceGroupName ?? null, VMGroupInputObject.VMGroupId ?? null, PrivateCloudName, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PrivateCloudName=PrivateCloudName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.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.VMware.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.VMware.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 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// 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) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationQuotaAvailability_Check.cs b/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationQuotaAvailability_Check.cs index 004de4f88f15..cc0fd31b65db 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationQuotaAvailability_Check.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationQuotaAvailability_Check.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Return quota for subscription by region @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] CheckQuotaAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzVMwareLocationQuotaAvailability_Check", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return quota for subscription by region")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkQuotaAvailability", ApiVersion = "2023-03-01")] public partial class TestAzVMwareLocationQuotaAvailability_Check : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,42 @@ public partial class TestAzVMwareLocationQuotaAvailability_Check : global::Syste /// 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; + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -90,7 +113,7 @@ public partial class TestAzVMwareLocationQuotaAvailability_Check : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -122,7 +145,8 @@ public partial class TestAzVMwareLocationQuotaAvailability_Check : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -131,24 +155,24 @@ public partial class TestAzVMwareLocationQuotaAvailability_Check : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IQuota + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota /// 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) @@ -171,7 +195,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -218,8 +246,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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +328,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -293,7 +346,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -313,7 +366,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public TestAzVMwareLocationQuotaAvailability_Check() { @@ -324,12 +377,12 @@ public TestAzVMwareLocationQuotaAvailability_Check() /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -346,15 +399,15 @@ public TestAzVMwareLocationQuotaAvailability_Check() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, Location=Location }) + 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 } }); @@ -364,12 +417,12 @@ public TestAzVMwareLocationQuotaAvailability_Check() /// 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.VMware.Models.Api20211201.IQuota + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota /// 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 ) { @@ -381,8 +434,26 @@ public TestAzVMwareLocationQuotaAvailability_Check() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IQuota - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota + 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/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationTrialAvailability_Check.cs b/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationTrialAvailability_CheckExpanded.cs similarity index 77% rename from src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationTrialAvailability_Check.cs rename to src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationTrialAvailability_CheckExpanded.cs index caf8281b712b..6ef43227cbaf 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationTrialAvailability_Check.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/TestAzVMwareLocationTrialAvailability_CheckExpanded.cs @@ -6,18 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Return trial status for subscription by region /// /// [OpenAPI] CheckTrialAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzVMwareLocationTrialAvailability_Check", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial))] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzVMwareLocationTrialAvailability_CheckExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Return trial status for subscription by region")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] - public partial class TestAzVMwareLocationTrialAvailability_Check : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.AVS/locations/{location}/checkTrialAvailability", ApiVersion = "2023-03-01")] + public partial class TestAzVMwareLocationTrialAvailability_CheckExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,23 +37,45 @@ public partial class TestAzVMwareLocationTrialAvailability_Check : global::Syste /// 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; + + /// The resource model definition representing SKU + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ISku _skuBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Sku(); + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -87,10 +113,21 @@ public partial class TestAzVMwareLocationTrialAvailability_Check : global::Syste /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// The name of the SKU. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the SKU.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the SKU.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _skuBody.Name ?? null; set => _skuBody.Name = value; } + /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -122,7 +159,8 @@ public partial class TestAzVMwareLocationTrialAvailability_Check : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -131,24 +169,24 @@ public partial class TestAzVMwareLocationTrialAvailability_Check : global::Syste /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ITrial + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial /// 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) @@ -171,7 +209,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -218,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.VMware.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.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -275,7 +342,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -288,12 +355,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.LocationsCheckTrialAvailability(SubscriptionId, Location, onOk, onDefault, this, Pipeline); + await this.Client.LocationsCheckTrialAvailability(SubscriptionId, Location, _skuBody, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -313,9 +380,9 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// - public TestAzVMwareLocationTrialAvailability_Check() + public TestAzVMwareLocationTrialAvailability_CheckExpanded() { } @@ -324,12 +391,12 @@ public TestAzVMwareLocationTrialAvailability_Check() /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -346,15 +413,15 @@ public TestAzVMwareLocationTrialAvailability_Check() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Location=Location }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, Location=Location }) + 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 } }); @@ -364,12 +431,12 @@ public TestAzVMwareLocationTrialAvailability_Check() /// 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.VMware.Models.Api20211201.ITrial + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial /// 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 ) { @@ -381,8 +448,26 @@ public TestAzVMwareLocationTrialAvailability_Check() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ITrial - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateExpanded.cs new file mode 100644 index 000000000000..95d39758decb --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateExpanded.cs @@ -0,0 +1,583 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareAuthorization_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create an ExpressRoute Circuit Authorization in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareAuthorization_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// ExpressRoute Circuit Authorization + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the ExpressRoute Circuit Authorization in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the ExpressRoute Circuit Authorization in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the ExpressRoute Circuit Authorization in the private cloud", + SerializedName = @"authorizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AuthorizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// The name of the private cloud. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private cloud.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private cloud.", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareAuthorization_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareAuthorization_UpdateExpanded Clone() + { + var clone = new UpdateAzVMwareAuthorization_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._authorizationBody = this._authorizationBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PrivateCloudName = this.PrivateCloudName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AuthorizationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _authorizationBody = await this.Client.AuthorizationsGetWithResult(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, this, Pipeline); + this.Update_authorizationBody(); + await this.Client.AuthorizationsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _authorizationBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareAuthorization_UpdateExpanded() + { + + } + + private void Update_authorizationBody() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..2aa2c154a1fa --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded.cs @@ -0,0 +1,551 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareAuthorization_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create an ExpressRoute Circuit Authorization in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// ExpressRoute Circuit Authorization + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._authorizationBody = this._authorizationBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AuthorizationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _authorizationBody = await this.Client.AuthorizationsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_authorizationBody(); + await this.Client.AuthorizationsCreateOrUpdateViaIdentity(InputObject.Id, _authorizationBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AuthorizationName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AuthorizationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _authorizationBody = await this.Client.AuthorizationsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.AuthorizationName ?? null, this, Pipeline); + this.Update_authorizationBody(); + await this.Client.AuthorizationsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.AuthorizationName ?? null, _authorizationBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareAuthorization_UpdateViaIdentityExpanded() + { + + } + + private void Update_authorizationBody() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..cabdbab97929 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,567 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create an ExpressRoute Circuit Authorization in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/authorizations/{authorizationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create an ExpressRoute Circuit Authorization in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// ExpressRoute Circuit Authorization + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization _authorizationBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ExpressRouteAuthorization(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the ExpressRoute Circuit Authorization in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the ExpressRoute Circuit Authorization in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the ExpressRoute Circuit Authorization in the private cloud", + SerializedName = @"authorizationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AuthorizationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._authorizationBody = this._authorizationBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AuthorizationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/authorizations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _authorizationBody = await this.Client.AuthorizationsGetViaIdentityWithResult(PrivateCloudInputObject.Id, this, Pipeline); + this.Update_authorizationBody(); + await this.Client.AuthorizationsCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _authorizationBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + _authorizationBody = await this.Client.AuthorizationsGetWithResult(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, this, Pipeline); + this.Update_authorizationBody(); + await this.Client.AuthorizationsCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _authorizationBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzVMwareAuthorization_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + private void Update_authorizationBody() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IExpressRouteAuthorization + /// 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.VMware.Models.IExpressRouteAuthorization + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateExpanded.cs new file mode 100644 index 000000000000..c15ae4f84bb5 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateExpanded.cs @@ -0,0 +1,597 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cloud link in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareCloudLink_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cloud link in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareCloudLink_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cloud link resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// Identifier of the other private cloud participating in the link. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the other private cloud participating in the link.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the other private cloud participating in the link.", + SerializedName = @"linkedCloud", + PossibleTypes = new [] { typeof(string) })] + public string LinkedCloud { get => _cloudLinkBody.LinkedCloud ?? null; set => _cloudLinkBody.LinkedCloud = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cloud link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cloud link resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cloud link resource", + SerializedName = @"cloudLinkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudLinkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// The name of the private cloud. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private cloud.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private cloud.", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareCloudLink_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareCloudLink_UpdateExpanded Clone() + { + var clone = new UpdateAzVMwareCloudLink_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloudLinkBody = this._cloudLinkBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PrivateCloudName = this.PrivateCloudName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudLinksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _cloudLinkBody = await this.Client.CloudLinksGetWithResult(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, this, Pipeline); + this.Update_cloudLinkBody(); + await this.Client.CloudLinksCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _cloudLinkBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareCloudLink_UpdateExpanded() + { + + } + + private void Update_cloudLinkBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedCloud"))) + { + this.LinkedCloud = (string)(this.MyInvocation?.BoundParameters["LinkedCloud"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..fac6852dc9e9 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded.cs @@ -0,0 +1,565 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cloud link in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareCloudLink_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cloud link in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cloud link resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Identifier of the other private cloud participating in the link. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the other private cloud participating in the link.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the other private cloud participating in the link.", + SerializedName = @"linkedCloud", + PossibleTypes = new [] { typeof(string) })] + public string LinkedCloud { get => _cloudLinkBody.LinkedCloud ?? null; set => _cloudLinkBody.LinkedCloud = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloudLinkBody = this._cloudLinkBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudLinksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _cloudLinkBody = await this.Client.CloudLinksGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_cloudLinkBody(); + await this.Client.CloudLinksCreateOrUpdateViaIdentity(InputObject.Id, _cloudLinkBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.CloudLinkName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CloudLinkName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _cloudLinkBody = await this.Client.CloudLinksGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.CloudLinkName ?? null, this, Pipeline); + this.Update_cloudLinkBody(); + await this.Client.CloudLinksCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.CloudLinkName ?? null, _cloudLinkBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareCloudLink_UpdateViaIdentityExpanded() + { + + } + + private void Update_cloudLinkBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedCloud"))) + { + this.LinkedCloud = (string)(this.MyInvocation?.BoundParameters["LinkedCloud"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..17bf8cfd710e --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,581 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a cloud link in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/cloudLinks/{cloudLinkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a cloud link in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 cloud link resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink _cloudLinkBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.CloudLink(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// Identifier of the other private cloud participating in the link. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the other private cloud participating in the link.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the other private cloud participating in the link.", + SerializedName = @"linkedCloud", + PossibleTypes = new [] { typeof(string) })] + public string LinkedCloud { get => _cloudLinkBody.LinkedCloud ?? null; set => _cloudLinkBody.LinkedCloud = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cloud link resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cloud link resource")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cloud link resource", + SerializedName = @"cloudLinkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudLinkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._cloudLinkBody = this._cloudLinkBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudLinksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/cloudLinks/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _cloudLinkBody = await this.Client.CloudLinksGetViaIdentityWithResult(PrivateCloudInputObject.Id, this, Pipeline); + this.Update_cloudLinkBody(); + await this.Client.CloudLinksCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _cloudLinkBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + _cloudLinkBody = await this.Client.CloudLinksGetWithResult(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, this, Pipeline); + this.Update_cloudLinkBody(); + await this.Client.CloudLinksCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _cloudLinkBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzVMwareCloudLink_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + private void Update_cloudLinkBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("LinkedCloud"))) + { + this.LinkedCloud = (string)(this.MyInvocation?.BoundParameters["LinkedCloud"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.ICloudLink + /// 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.VMware.Models.ICloudLink + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateExpanded.cs index 46bbceb164f4..dc177d10d01b 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Update a cluster in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareCluster_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a cluster in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,7 +38,19 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// An update of a cluster resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate _clusterUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate _clusterUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdate(); + + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -46,6 +62,9 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -61,14 +80,18 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag public int ClusterSize { get => _clusterUpdateBody.ClusterSize ?? default(int); set => _clusterUpdateBody.ClusterSize = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -118,7 +141,7 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -144,7 +167,7 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - public string[] PropertiesHost { get => _clusterUpdateBody.Host ?? null /* arrayOf */; set => _clusterUpdateBody.Host = value; } + public string[] PropertiesHost { get => _clusterUpdateBody.Host?.ToArray() ?? null /* fixedArrayOf */; set => _clusterUpdateBody.Host = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -190,7 +213,8 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -199,24 +223,24 @@ public partial class UpdateAzVMwareCluster_UpdateExpanded : global::System.Manag /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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) @@ -264,7 +288,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareCluster_U /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -311,11 +339,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -327,10 +380,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -398,7 +467,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -411,12 +480,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ClustersUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _clusterUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.ClustersUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _clusterUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name,body=_clusterUpdateBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -436,7 +505,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareCluster_UpdateExpanded() { @@ -447,12 +516,12 @@ public UpdateAzVMwareCluster_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -469,15 +538,15 @@ public UpdateAzVMwareCluster_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_clusterUpdateBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, Name=Name, body=_clusterUpdateBody }) + 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 } }); @@ -487,12 +556,12 @@ public UpdateAzVMwareCluster_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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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 ) { @@ -504,8 +573,26 @@ public UpdateAzVMwareCluster_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityExpanded.cs index 20307b22627f..74321b6ee14d 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Update a cluster in a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareCluster_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a cluster in a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,7 +38,19 @@ public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::S private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// An update of a cluster resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IClusterUpdate _clusterUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ClusterUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate _clusterUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdate(); + + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -46,6 +62,9 @@ public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -61,14 +80,18 @@ public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::S public int ClusterSize { get => _clusterUpdateBody.ClusterSize ?? default(int); set => _clusterUpdateBody.ClusterSize = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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] @@ -111,7 +134,7 @@ public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// The hosts [global::System.Management.Automation.AllowEmptyCollection] @@ -123,7 +146,7 @@ public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::S Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - public string[] PropertiesHost { get => _clusterUpdateBody.Host ?? null /* arrayOf */; set => _clusterUpdateBody.Host = value; } + public string[] PropertiesHost { get => _clusterUpdateBody.Host?.ToArray() ?? null /* fixedArrayOf */; set => _clusterUpdateBody.Host = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -146,24 +169,24 @@ public partial class UpdateAzVMwareCluster_UpdateViaIdentityExpanded : global::S /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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) @@ -207,7 +230,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareCluster_U /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -254,11 +281,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -270,10 +322,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -341,7 +409,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -356,7 +424,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ClustersUpdateViaIdentity(InputObject.Id, _clusterUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.ClustersUpdateViaIdentity(InputObject.Id, _clusterUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -377,13 +445,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ClustersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, _clusterUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.ClustersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, _clusterUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterUpdateBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -403,7 +471,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareCluster_UpdateViaIdentityExpanded() { @@ -414,12 +482,12 @@ public UpdateAzVMwareCluster_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -436,15 +504,15 @@ public UpdateAzVMwareCluster_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterUpdateBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_clusterUpdateBody }) + 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 } }); @@ -454,12 +522,12 @@ public UpdateAzVMwareCluster_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.VMware.Models.Api20211201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster /// 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 ) { @@ -471,8 +539,26 @@ public UpdateAzVMwareCluster_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..b7544abfba84 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded.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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a cluster in a private cloud + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a cluster in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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(); + + /// An update of a cluster resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterUpdate _clusterUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ClusterUpdate(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// The cluster size + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The cluster size")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The cluster size", + SerializedName = @"clusterSize", + PossibleTypes = new [] { typeof(int) })] + public int ClusterSize { get => _clusterUpdateBody.ClusterSize ?? default(int); set => _clusterUpdateBody.ClusterSize = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// The hosts + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The hosts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The hosts", + SerializedName = @"hosts", + PossibleTypes = new [] { typeof(string) })] + public string[] PropertiesHost { get => _clusterUpdateBody.Host?.ToArray() ?? null /* fixedArrayOf */; set => _clusterUpdateBody.Host = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._clusterUpdateBody = this._clusterUpdateBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ClustersUpdateViaIdentity(PrivateCloudInputObject.Id, _clusterUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.ClustersUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _clusterUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareCluster_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.ICluster + /// 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.VMware.Models.ICluster + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateExpanded.cs new file mode 100644 index 000000000000..7ca30febdea4 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateExpanded.cs @@ -0,0 +1,660 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareDatastore_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareDatastore_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// Name of the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the private cloud", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareDatastore_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareDatastore_UpdateExpanded Clone() + { + var clone = new UpdateAzVMwareDatastore_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PrivateCloudName = this.PrivateCloudName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _datastoreBody = await this.Client.DatastoresGetWithResult(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _datastoreBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareDatastore_UpdateExpanded() + { + + } + + private void Update_datastoreBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("NetAppVolumeId"))) + { + this.NetAppVolumeId = (string)(this.MyInvocation?.BoundParameters["NetAppVolumeId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeTargetId"))) + { + this.DiskPoolVolumeTargetId = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeTargetId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeLunName"))) + { + this.DiskPoolVolumeLunName = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeLunName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeMountOption"))) + { + this.DiskPoolVolumeMountOption = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeMountOption"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..22728f310c16 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded.cs @@ -0,0 +1,632 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareDatastore_UpdateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded Clone() + { + var clone = new UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _datastoreBody = await this.Client.DatastoresGetViaIdentityWithResult(ClusterInputObject.Id, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdateViaIdentity(ClusterInputObject.Id, _datastoreBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + _datastoreBody = await this.Client.DatastoresGetWithResult(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, _datastoreBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareDatastore_UpdateViaIdentityClusterExpanded() + { + + } + + private void Update_datastoreBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("NetAppVolumeId"))) + { + this.NetAppVolumeId = (string)(this.MyInvocation?.BoundParameters["NetAppVolumeId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeTargetId"))) + { + this.DiskPoolVolumeTargetId = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeTargetId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeLunName"))) + { + this.DiskPoolVolumeLunName = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeLunName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeMountOption"))) + { + this.DiskPoolVolumeMountOption = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeMountOption"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..c1039985e5aa --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityExpanded.cs @@ -0,0 +1,617 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareDatastore_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareDatastore_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareDatastore_UpdateViaIdentityExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareDatastore_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzVMwareDatastore_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _datastoreBody = await this.Client.DatastoresGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdateViaIdentity(InputObject.Id, _datastoreBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.DatastoreName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DatastoreName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _datastoreBody = await this.Client.DatastoresGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, InputObject.DatastoreName ?? null, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, InputObject.DatastoreName ?? null, _datastoreBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareDatastore_UpdateViaIdentityExpanded() + { + + } + + private void Update_datastoreBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("NetAppVolumeId"))) + { + this.NetAppVolumeId = (string)(this.MyInvocation?.BoundParameters["NetAppVolumeId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeTargetId"))) + { + this.DiskPoolVolumeTargetId = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeTargetId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeLunName"))) + { + this.DiskPoolVolumeLunName = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeLunName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeMountOption"))) + { + this.DiskPoolVolumeMountOption = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeMountOption"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..08022164981c --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,644 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a datastore in a private cloud cluster + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/datastores/{datastoreName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a datastore in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 datastore resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore _datastoreBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Datastore(); + + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Name of the LUN to be used for datastore + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the LUN to be used for datastore")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the LUN to be used for datastore", + SerializedName = @"lunName", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeLunName { get => _datastoreBody.DiskPoolVolumeLunName ?? null; set => _datastoreBody.DiskPoolVolumeLunName = value; } + + /// + /// Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN", + SerializedName = @"mountOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("MOUNT", "ATTACH")] + public string DiskPoolVolumeMountOption { get => _datastoreBody.DiskPoolVolumeMountOption ?? null; set => _datastoreBody.DiskPoolVolumeMountOption = value; } + + /// Azure resource ID of the iSCSI target + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the iSCSI target")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the iSCSI target", + SerializedName = @"targetId", + PossibleTypes = new [] { typeof(string) })] + public string DiskPoolVolumeTargetId { get => _datastoreBody.DiskPoolVolumeTargetId ?? null; set => _datastoreBody.DiskPoolVolumeTargetId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the datastore in the private cloud cluster + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the datastore in the private cloud cluster")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the datastore in the private cloud cluster", + SerializedName = @"datastoreName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DatastoreName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// Azure resource ID of the NetApp volume + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Azure resource ID of the NetApp volume")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Azure resource ID of the NetApp volume", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + public string NetAppVolumeId { get => _datastoreBody.NetAppVolumeId ?? null; set => _datastoreBody.NetAppVolumeId = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._datastoreBody = this._datastoreBody; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'DatastoresCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/datastores/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _datastoreBody = await this.Client.DatastoresGetViaIdentityWithResult(PrivateCloudInputObject.Id, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _datastoreBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + _datastoreBody = await this.Client.DatastoresGetWithResult(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, this, Pipeline); + this.Update_datastoreBody(); + await this.Client.DatastoresCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, _datastoreBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzVMwareDatastore_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + private void Update_datastoreBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("NetAppVolumeId"))) + { + this.NetAppVolumeId = (string)(this.MyInvocation?.BoundParameters["NetAppVolumeId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeTargetId"))) + { + this.DiskPoolVolumeTargetId = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeTargetId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeLunName"))) + { + this.DiskPoolVolumeLunName = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeLunName"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("DiskPoolVolumeMountOption"))) + { + this.DiskPoolVolumeMountOption = (string)(this.MyInvocation?.BoundParameters["DiskPoolVolumeMountOption"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IDatastore + /// 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.VMware.Models.IDatastore + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateExpanded.cs new file mode 100644 index 000000000000..4fa317129819 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateExpanded.cs @@ -0,0 +1,633 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a global reach connection in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareGlobalReachConnection_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a global reach connection in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareGlobalReachConnection_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 global reach connection resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Authorization key from the peer express route used for the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authorization key from the peer express route used for the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization key from the peer express route used for the global reach connection", + SerializedName = @"authorizationKey", + PossibleTypes = new [] { typeof(string) })] + public string AuthorizationKey { get => _globalReachConnectionBody.AuthorizationKey ?? null; set => _globalReachConnectionBody.AuthorizationKey = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", + SerializedName = @"expressRouteId", + PossibleTypes = new [] { typeof(string) })] + public string ExpressRouteId { get => _globalReachConnectionBody.ExpressRouteId ?? null; set => _globalReachConnectionBody.ExpressRouteId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the global reach connection in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the global reach connection in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the global reach connection in the private cloud", + SerializedName = @"globalReachConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GlobalReachConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Identifier of the ExpressRoute Circuit to peer with in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the ExpressRoute Circuit to peer with in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", + SerializedName = @"peerExpressRouteCircuit", + PossibleTypes = new [] { typeof(string) })] + public string PeerExpressRouteCircuit { get => _globalReachConnectionBody.PeerExpressRouteCircuit ?? null; set => _globalReachConnectionBody.PeerExpressRouteCircuit = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _privateCloudName; + + /// The name of the private cloud. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private cloud.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private cloud.", + SerializedName = @"privateCloudName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PrivateCloudName { get => this._privateCloudName; set => this._privateCloudName = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// The name of the resource group. The name is case insensitive. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzVMwareGlobalReachConnection_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareGlobalReachConnection_UpdateExpanded Clone() + { + var clone = new UpdateAzVMwareGlobalReachConnection_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._globalReachConnectionBody = this._globalReachConnectionBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.PrivateCloudName = this.PrivateCloudName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GlobalReachConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + _globalReachConnectionBody = await this.Client.GlobalReachConnectionsGetWithResult(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, this, Pipeline); + this.Update_globalReachConnectionBody(); + await this.Client.GlobalReachConnectionsCreateOrUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, Name, _globalReachConnectionBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareGlobalReachConnection_UpdateExpanded() + { + + } + + private void Update_globalReachConnectionBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AuthorizationKey"))) + { + this.AuthorizationKey = (string)(this.MyInvocation?.BoundParameters["AuthorizationKey"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PeerExpressRouteCircuit"))) + { + this.PeerExpressRouteCircuit = (string)(this.MyInvocation?.BoundParameters["PeerExpressRouteCircuit"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpressRouteId"))) + { + this.ExpressRouteId = (string)(this.MyInvocation?.BoundParameters["ExpressRouteId"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..1750d0a8950d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded.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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a global reach connection in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareGlobalReachConnection_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a global reach connection in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 global reach connection resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Authorization key from the peer express route used for the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authorization key from the peer express route used for the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization key from the peer express route used for the global reach connection", + SerializedName = @"authorizationKey", + PossibleTypes = new [] { typeof(string) })] + public string AuthorizationKey { get => _globalReachConnectionBody.AuthorizationKey ?? null; set => _globalReachConnectionBody.AuthorizationKey = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", + SerializedName = @"expressRouteId", + PossibleTypes = new [] { typeof(string) })] + public string ExpressRouteId { get => _globalReachConnectionBody.ExpressRouteId ?? null; set => _globalReachConnectionBody.ExpressRouteId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Identifier of the ExpressRoute Circuit to peer with in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the ExpressRoute Circuit to peer with in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", + SerializedName = @"peerExpressRouteCircuit", + PossibleTypes = new [] { typeof(string) })] + public string PeerExpressRouteCircuit { get => _globalReachConnectionBody.PeerExpressRouteCircuit ?? null; set => _globalReachConnectionBody.PeerExpressRouteCircuit = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._globalReachConnectionBody = this._globalReachConnectionBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GlobalReachConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + _globalReachConnectionBody = await this.Client.GlobalReachConnectionsGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.Update_globalReachConnectionBody(); + await this.Client.GlobalReachConnectionsCreateOrUpdateViaIdentity(InputObject.Id, _globalReachConnectionBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + 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) ); + } + if (null == InputObject.ResourceGroupName) + { + 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) ); + } + if (null == InputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.GlobalReachConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.GlobalReachConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + _globalReachConnectionBody = await this.Client.GlobalReachConnectionsGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.GlobalReachConnectionName ?? null, this, Pipeline); + this.Update_globalReachConnectionBody(); + await this.Client.GlobalReachConnectionsCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.GlobalReachConnectionName ?? null, _globalReachConnectionBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityExpanded() + { + + } + + private void Update_globalReachConnectionBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AuthorizationKey"))) + { + this.AuthorizationKey = (string)(this.MyInvocation?.BoundParameters["AuthorizationKey"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PeerExpressRouteCircuit"))) + { + this.PeerExpressRouteCircuit = (string)(this.MyInvocation?.BoundParameters["PeerExpressRouteCircuit"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpressRouteId"))) + { + this.ExpressRouteId = (string)(this.MyInvocation?.BoundParameters["ExpressRouteId"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..4ab9dfe146dc --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,617 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Create a global reach connection in a private cloud + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/globalReachConnections/{globalReachConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create a global reach connection in a private cloud")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + public partial class UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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 global reach connection resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection _globalReachConnectionBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.GlobalReachConnection(); + + /// + /// 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; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Authorization key from the peer express route used for the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Authorization key from the peer express route used for the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Authorization key from the peer express route used for the global reach connection", + SerializedName = @"authorizationKey", + PossibleTypes = new [] { typeof(string) })] + public string AuthorizationKey { get => _globalReachConnectionBody.AuthorizationKey ?? null; set => _globalReachConnectionBody.AuthorizationKey = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection", + SerializedName = @"expressRouteId", + PossibleTypes = new [] { typeof(string) })] + public string ExpressRouteId { get => _globalReachConnectionBody.ExpressRouteId ?? null; set => _globalReachConnectionBody.ExpressRouteId = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the global reach connection in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the global reach connection in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the global reach connection in the private cloud", + SerializedName = @"globalReachConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("GlobalReachConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// Identifier of the ExpressRoute Circuit to peer with in the global reach connection + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifier of the ExpressRoute Circuit to peer with in the global reach connection")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifier of the ExpressRoute Circuit to peer with in the global reach connection", + SerializedName = @"peerExpressRouteCircuit", + PossibleTypes = new [] { typeof(string) })] + public string PeerExpressRouteCircuit { get => _globalReachConnectionBody.PeerExpressRouteCircuit ?? null; set => _globalReachConnectionBody.PeerExpressRouteCircuit = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// 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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._globalReachConnectionBody = this._globalReachConnectionBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'GlobalReachConnectionsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/globalReachConnections/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + _globalReachConnectionBody = await this.Client.GlobalReachConnectionsGetViaIdentityWithResult(PrivateCloudInputObject.Id, this, Pipeline); + this.Update_globalReachConnectionBody(); + await this.Client.GlobalReachConnectionsCreateOrUpdateViaIdentity(PrivateCloudInputObject.Id, _globalReachConnectionBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + _globalReachConnectionBody = await this.Client.GlobalReachConnectionsGetWithResult(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, this, Pipeline); + this.Update_globalReachConnectionBody(); + await this.Client.GlobalReachConnectionsCreateOrUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, Name, _globalReachConnectionBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareGlobalReachConnection_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + private void Update_globalReachConnectionBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AuthorizationKey"))) + { + this.AuthorizationKey = (string)(this.MyInvocation?.BoundParameters["AuthorizationKey"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("PeerExpressRouteCircuit"))) + { + this.PeerExpressRouteCircuit = (string)(this.MyInvocation?.BoundParameters["PeerExpressRouteCircuit"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ExpressRouteId"))) + { + this.ExpressRouteId = (string)(this.MyInvocation?.BoundParameters["ExpressRouteId"]); + } + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IGlobalReachConnection + /// 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.VMware.Models.IGlobalReachConnection + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateExpanded.cs index 570535476e27..89eb07db77a5 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Update a placement policy in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwarePlacementPolicy_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a placement policy in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,19 +37,58 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst /// 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; + /// An update of a DRS placement policy resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate _placementPolicyUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate _placementPolicyUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdate(); + + /// + /// 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; + + /// vm-host placement policy affinity strength (should/must) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "vm-host placement policy affinity strength (should/must)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + public string AffinityStrength { get => _placementPolicyUpdateBody.AffinityStrength ?? null; set => _placementPolicyUpdateBody.AffinityStrength = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// placement policy azure hybrid benefit opt-in type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy azure hybrid benefit opt-in type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + public string AzureHybridBenefitType { get => _placementPolicyUpdateBody.AzureHybridBenefitType ?? null; set => _placementPolicyUpdateBody.AzureHybridBenefitType = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -64,14 +107,18 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Host members list [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Host members list")] @@ -82,7 +129,7 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst Description = @"Host members list", SerializedName = @"hostMembers", PossibleTypes = new [] { typeof(string) })] - public string[] HostMember { get => _placementPolicyUpdateBody.HostMember ?? null /* arrayOf */; set => _placementPolicyUpdateBody.HostMember = value; } + public string[] HostMember { get => _placementPolicyUpdateBody.HostMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.HostMember = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -135,7 +182,7 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -189,9 +236,9 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst ReadOnly = false, Description = @"Whether the placement policy is enabled or disabled", SerializedName = @"state", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState State { get => _placementPolicyUpdateBody.State ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState)""); set => _placementPolicyUpdateBody.State = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string State { get => _placementPolicyUpdateBody.State ?? null; set => _placementPolicyUpdateBody.State = value; } /// Backing field for property. private string _subscriptionId; @@ -207,7 +254,8 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -221,31 +269,31 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateExpanded : global::Syst Description = @"Virtual machine members list", SerializedName = @"vmMembers", PossibleTypes = new [] { typeof(string) })] - public string[] VMMember { get => _placementPolicyUpdateBody.VMMember ?? null /* arrayOf */; set => _placementPolicyUpdateBody.VMMember = value; } + public string[] VMMember { get => _placementPolicyUpdateBody.VMMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.VMMember = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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) @@ -294,7 +342,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwarePlacement /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -341,11 +393,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -357,10 +434,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -428,7 +521,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -441,12 +534,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PlacementPoliciesUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.PlacementPoliciesUpdate(SubscriptionId, ResourceGroupName, PrivateCloudName, ClusterName, Name, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name,body=_placementPolicyUpdateBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -466,7 +559,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwarePlacementPolicy_UpdateExpanded() { @@ -477,12 +570,12 @@ public UpdateAzVMwarePlacementPolicy_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -499,15 +592,15 @@ public UpdateAzVMwarePlacementPolicy_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name, body=_placementPolicyUpdateBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, ClusterName=ClusterName, Name=Name, body=_placementPolicyUpdateBody }) + 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 } }); @@ -517,12 +610,12 @@ public UpdateAzVMwarePlacementPolicy_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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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 ) { @@ -534,8 +627,26 @@ public UpdateAzVMwarePlacementPolicy_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..5693ce514888 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded.cs @@ -0,0 +1,624 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a placement policy in a private cloud cluster + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// An update of a DRS placement policy resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate _placementPolicyUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdate(); + + /// + /// 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; + + /// vm-host placement policy affinity strength (should/must) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "vm-host placement policy affinity strength (should/must)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + public string AffinityStrength { get => _placementPolicyUpdateBody.AffinityStrength ?? null; set => _placementPolicyUpdateBody.AffinityStrength = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// placement policy azure hybrid benefit opt-in type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy azure hybrid benefit opt-in type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + public string AzureHybridBenefitType { get => _placementPolicyUpdateBody.AzureHybridBenefitType ?? null; set => _placementPolicyUpdateBody.AzureHybridBenefitType = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Host members list + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Host members list")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host members list", + SerializedName = @"hostMembers", + PossibleTypes = new [] { typeof(string) })] + public string[] HostMember { get => _placementPolicyUpdateBody.HostMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.HostMember = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Whether the placement policy is enabled or disabled + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether the placement policy is enabled or disabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the placement policy is enabled or disabled", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string State { get => _placementPolicyUpdateBody.State ?? null; set => _placementPolicyUpdateBody.State = value; } + + /// Virtual machine members list + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Virtual machine members list")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Virtual machine members list", + SerializedName = @"vmMembers", + PossibleTypes = new [] { typeof(string) })] + public string[] VMMember { get => _placementPolicyUpdateBody.VMMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.VMMember = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded Clone() + { + var clone = new UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._placementPolicyUpdateBody = this._placementPolicyUpdateBody; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesUpdateViaIdentity(ClusterInputObject.Id, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.PlacementPoliciesUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.PrivateCloudName ?? null, ClusterInputObject.ClusterName ?? null, Name, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzVMwarePlacementPolicy_UpdateViaIdentityClusterExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded.cs index a78c4c07c3f3..7f8084b4d09e 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Update a placement policy in a private cloud cluster @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwarePlacementPolicy_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a placement policy in a private cloud cluster")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,31 +37,74 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded : g /// 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; + /// An update of a DRS placement policy resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyUpdate _placementPolicyUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PlacementPolicyUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate _placementPolicyUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdate(); + + /// + /// 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; + + /// vm-host placement policy affinity strength (should/must) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "vm-host placement policy affinity strength (should/must)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + public string AffinityStrength { get => _placementPolicyUpdateBody.AffinityStrength ?? null; set => _placementPolicyUpdateBody.AffinityStrength = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + /// placement policy azure hybrid benefit opt-in type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy azure hybrid benefit opt-in type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + public string AzureHybridBenefitType { get => _placementPolicyUpdateBody.AzureHybridBenefitType ?? null; set => _placementPolicyUpdateBody.AzureHybridBenefitType = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Host members list [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Host members list")] @@ -68,7 +115,7 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded : g Description = @"Host members list", SerializedName = @"hostMembers", PossibleTypes = new [] { typeof(string) })] - public string[] HostMember { get => _placementPolicyUpdateBody.HostMember ?? null /* arrayOf */; set => _placementPolicyUpdateBody.HostMember = value; } + public string[] HostMember { get => _placementPolicyUpdateBody.HostMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.HostMember = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -112,7 +159,7 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -138,9 +185,9 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"Whether the placement policy is enabled or disabled", SerializedName = @"state", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState State { get => _placementPolicyUpdateBody.State ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState)""); set => _placementPolicyUpdateBody.State = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string State { get => _placementPolicyUpdateBody.State ?? null; set => _placementPolicyUpdateBody.State = value; } /// Virtual machine members list [global::System.Management.Automation.AllowEmptyCollection] @@ -152,31 +199,31 @@ public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded : g Description = @"Virtual machine members list", SerializedName = @"vmMembers", PossibleTypes = new [] { typeof(string) })] - public string[] VMMember { get => _placementPolicyUpdateBody.VMMember ?? null /* arrayOf */; set => _placementPolicyUpdateBody.VMMember = value; } + public string[] VMMember { get => _placementPolicyUpdateBody.VMMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.VMMember = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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) @@ -220,7 +267,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwarePlacement /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -267,11 +318,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -283,10 +359,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -354,7 +446,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -369,7 +461,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.PlacementPoliciesUpdateViaIdentity(InputObject.Id, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.PlacementPoliciesUpdateViaIdentity(InputObject.Id, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -394,13 +486,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PlacementPolicyName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.PlacementPoliciesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, InputObject.PlacementPolicyName ?? null, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.PlacementPoliciesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.ClusterName ?? null, InputObject.PlacementPolicyName ?? null, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_placementPolicyUpdateBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -420,7 +512,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded() { @@ -431,12 +523,12 @@ public UpdateAzVMwarePlacementPolicy_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -453,15 +545,15 @@ public UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_placementPolicyUpdateBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_placementPolicyUpdateBody }) + 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 } }); @@ -471,12 +563,12 @@ public UpdateAzVMwarePlacementPolicy_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.VMware.Models.Api20211201.IPlacementPolicy + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy /// 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 ) { @@ -488,8 +580,26 @@ public UpdateAzVMwarePlacementPolicy_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicy - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..023b02572673 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,635 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a placement policy in a private cloud cluster + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a placement policy in a private cloud cluster")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// An update of a DRS placement policy resource + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyUpdate _placementPolicyUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PlacementPolicyUpdate(); + + /// + /// 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; + + /// vm-host placement policy affinity strength (should/must) + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "vm-host placement policy affinity strength (should/must)")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"vm-host placement policy affinity strength (should/must)", + SerializedName = @"affinityStrength", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Should", "Must")] + public string AffinityStrength { get => _placementPolicyUpdateBody.AffinityStrength ?? null; set => _placementPolicyUpdateBody.AffinityStrength = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// placement policy azure hybrid benefit opt-in type + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "placement policy azure hybrid benefit opt-in type")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"placement policy azure hybrid benefit opt-in type", + SerializedName = @"azureHybridBenefitType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SqlHost", "None")] + public string AzureHybridBenefitType { get => _placementPolicyUpdateBody.AzureHybridBenefitType ?? null; set => _placementPolicyUpdateBody.AzureHybridBenefitType = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// Name of the cluster in the private cloud + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the cluster in the private cloud")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the cluster in the private cloud", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// Host members list + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Host members list")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Host members list", + SerializedName = @"hostMembers", + PossibleTypes = new [] { typeof(string) })] + public string[] HostMember { get => _placementPolicyUpdateBody.HostMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.HostMember = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy", + SerializedName = @"placementPolicyName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PlacementPolicyName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Whether the placement policy is enabled or disabled + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether the placement policy is enabled or disabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Whether the placement policy is enabled or disabled", + SerializedName = @"state", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string State { get => _placementPolicyUpdateBody.State ?? null; set => _placementPolicyUpdateBody.State = value; } + + /// Virtual machine members list + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Virtual machine members list")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Virtual machine members list", + SerializedName = @"vmMembers", + PossibleTypes = new [] { typeof(string) })] + public string[] VMMember { get => _placementPolicyUpdateBody.VMMember?.ToArray() ?? null /* fixedArrayOf */; set => _placementPolicyUpdateBody.VMMember = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// 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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._placementPolicyUpdateBody = this._placementPolicyUpdateBody; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PlacementPoliciesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/clusters/{(global::System.Uri.EscapeDataString(this.ClusterName.ToString()))}/placementPolicies/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.PlacementPoliciesUpdateViaIdentity(PrivateCloudInputObject.Id, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.PlacementPoliciesUpdate(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, ClusterName, Name, _placementPolicyUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ClusterName=ClusterName,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzVMwarePlacementPolicy_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IPlacementPolicy + /// 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.VMware.Models.IPlacementPolicy + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateExpanded.cs index aba22950e024..6ae48434b33a 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Update a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwarePrivateCloud_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,60 +37,42 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. /// 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; + /// An update to a private cloud resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate _privateCloudUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate _privateCloudUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdate(); + + /// + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// The secondary availability zone for the private cloud - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The secondary availability zone for the private cloud")] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The secondary availability zone for the private cloud", - SerializedName = @"secondaryZone", - PossibleTypes = new [] { typeof(int) })] - public int AvailabilitySecondaryZone { get => _privateCloudUpdateBody.AvailabilitySecondaryZone ?? default(int); set => _privateCloudUpdateBody.AvailabilitySecondaryZone = value; } - - /// The availability strategy for the private cloud - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The availability strategy for the private cloud")] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The availability strategy for the private cloud", - SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy AvailabilityStrategy { get => _privateCloudUpdateBody.AvailabilityStrategy ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); set => _privateCloudUpdateBody.AvailabilityStrategy = value; } - - /// The primary availability zone for the private cloud - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The primary availability zone for the private cloud")] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The primary availability zone for the private cloud", - SerializedName = @"zone", - PossibleTypes = new [] { typeof(int) })] - public int AvailabilityZone { get => _privateCloudUpdateBody.AvailabilityZone ?? default(int); set => _privateCloudUpdateBody.AvailabilityZone = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -100,9 +86,28 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. ReadOnly = false, Description = @"Status of customer managed encryption key", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState EncryptionStatus { get => _privateCloudUpdateBody.EncryptionStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); set => _privateCloudUpdateBody.EncryptionStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string EncryptionStatus { get => _privateCloudUpdateBody.EncryptionStatus ?? null; set => _privateCloudUpdateBody.EncryptionStatus = value; } + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).", + SerializedName = @"extendedNetworkBlocks", + PossibleTypes = new [] { typeof(string) })] + public string[] ExtendedNetworkBlock { get => _privateCloudUpdateBody.ExtendedNetworkBlock?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudUpdateBody.ExtendedNetworkBlock = (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")] @@ -125,8 +130,8 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. ReadOnly = false, Description = @"vCenter Single Sign On Identity Sources", SerializedName = @"identitySources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => _privateCloudUpdateBody.IdentitySource ?? null /* arrayOf */; set => _privateCloudUpdateBody.IdentitySource = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] IdentitySource { get => _privateCloudUpdateBody.IdentitySource?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudUpdateBody.IdentitySource = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The @@ -139,9 +144,9 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. ReadOnly = false, Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType IdentityType { get => _privateCloudUpdateBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType)""); set => _privateCloudUpdateBody.IdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + public string IdentityType { get => _privateCloudUpdateBody.IdentityType ?? null; set => _privateCloudUpdateBody.IdentityType = value; } /// Connectivity to internet is enabled or disabled [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Connectivity to internet is enabled or disabled")] @@ -151,9 +156,9 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. ReadOnly = false, Description = @"Connectivity to internet is enabled or disabled", SerializedName = @"internet", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum Internet { get => _privateCloudUpdateBody.Internet ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum)""); set => _privateCloudUpdateBody.Internet = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string Internet { get => _privateCloudUpdateBody.Internet ?? null; set => _privateCloudUpdateBody.Internet = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -201,7 +206,7 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - public string[] ManagementClusterHost { get => _privateCloudUpdateBody.ManagementClusterHost ?? null /* arrayOf */; set => _privateCloudUpdateBody.ManagementClusterHost = value; } + public string[] ManagementClusterHost { get => _privateCloudUpdateBody.ManagementClusterHost?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudUpdateBody.ManagementClusterHost = (value != null ? new System.Collections.Generic.List(value) : null); } /// The cluster size [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The cluster size")] @@ -248,7 +253,7 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -294,7 +299,8 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -307,32 +313,32 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateExpanded : global::System. ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get => _privateCloudUpdateBody.Tag ?? null /* object */; set => _privateCloudUpdateBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get => _privateCloudUpdateBody.Tag ?? null /* object */; set => _privateCloudUpdateBody.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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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) @@ -379,7 +385,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwarePrivateCl /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -426,11 +436,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -442,10 +477,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -513,7 +564,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -526,12 +577,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.PrivateCloudsUpdate(SubscriptionId, ResourceGroupName, Name, _privateCloudUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.PrivateCloudsUpdate(SubscriptionId, ResourceGroupName, Name, _privateCloudUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,body=_privateCloudUpdateBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -551,7 +602,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwarePrivateCloud_UpdateExpanded() { @@ -562,12 +613,12 @@ public UpdateAzVMwarePrivateCloud_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -584,15 +635,15 @@ public UpdateAzVMwarePrivateCloud_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_privateCloudUpdateBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, Name=Name, body=_privateCloudUpdateBody }) + 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 } }); @@ -602,12 +653,12 @@ public UpdateAzVMwarePrivateCloud_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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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 ) { @@ -619,8 +670,26 @@ public UpdateAzVMwarePrivateCloud_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded.cs index db11176a887d..33842b70dbcc 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; /// Update a private cloud @@ -13,11 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwarePrivateCloud_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud))] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a private cloud")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,60 +37,42 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob /// 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; + /// An update to a private cloud resource - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloudUpdate _privateCloudUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.PrivateCloudUpdate(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloudUpdate _privateCloudUpdateBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PrivateCloudUpdate(); + + /// + /// 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; /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter AsJob { get; set; } - /// The secondary availability zone for the private cloud - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The secondary availability zone for the private cloud")] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The secondary availability zone for the private cloud", - SerializedName = @"secondaryZone", - PossibleTypes = new [] { typeof(int) })] - public int AvailabilitySecondaryZone { get => _privateCloudUpdateBody.AvailabilitySecondaryZone ?? default(int); set => _privateCloudUpdateBody.AvailabilitySecondaryZone = value; } - - /// The availability strategy for the private cloud - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The availability strategy for the private cloud")] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The availability strategy for the private cloud", - SerializedName = @"strategy", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy AvailabilityStrategy { get => _privateCloudUpdateBody.AvailabilityStrategy ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy)""); set => _privateCloudUpdateBody.AvailabilityStrategy = value; } - - /// The primary availability zone for the private cloud - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The primary availability zone for the private cloud")] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The primary availability zone for the private cloud", - SerializedName = @"zone", - PossibleTypes = new [] { typeof(int) })] - public int AvailabilityZone { get => _privateCloudUpdateBody.AvailabilityZone ?? default(int); set => _privateCloudUpdateBody.AvailabilityZone = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -100,9 +86,28 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"Status of customer managed encryption key", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState EncryptionStatus { get => _privateCloudUpdateBody.EncryptionStatus ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState)""); set => _privateCloudUpdateBody.EncryptionStatus = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string EncryptionStatus { get => _privateCloudUpdateBody.EncryptionStatus ?? null; set => _privateCloudUpdateBody.EncryptionStatus = value; } + + /// + /// Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet + /// in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to + /// (A.B.C.D/X). + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of additional networks noncontiguous with networkBlock. Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. Make sure the CIDR format conforms to (A.B.C.D/X).", + SerializedName = @"extendedNetworkBlocks", + PossibleTypes = new [] { typeof(string) })] + public string[] ExtendedNetworkBlock { get => _privateCloudUpdateBody.ExtendedNetworkBlock?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudUpdateBody.ExtendedNetworkBlock = (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")] @@ -125,8 +130,8 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"vCenter Single Sign On Identity Sources", SerializedName = @"identitySources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] IdentitySource { get => _privateCloudUpdateBody.IdentitySource ?? null /* arrayOf */; set => _privateCloudUpdateBody.IdentitySource = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] IdentitySource { get => _privateCloudUpdateBody.IdentitySource?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudUpdateBody.IdentitySource = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The @@ -139,9 +144,9 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"The type of identity used for the private cloud. The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType IdentityType { get => _privateCloudUpdateBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType)""); set => _privateCloudUpdateBody.IdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] + public string IdentityType { get => _privateCloudUpdateBody.IdentityType ?? null; set => _privateCloudUpdateBody.IdentityType = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _inputObject; @@ -159,9 +164,9 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"Connectivity to internet is enabled or disabled", SerializedName = @"internet", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum Internet { get => _privateCloudUpdateBody.Internet ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum)""); set => _privateCloudUpdateBody.Internet = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] + public string Internet { get => _privateCloudUpdateBody.Internet ?? null; set => _privateCloudUpdateBody.Internet = value; } /// Accessor for our copy of the InvocationInfo. public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } @@ -209,7 +214,7 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob Description = @"The hosts", SerializedName = @"hosts", PossibleTypes = new [] { typeof(string) })] - public string[] ManagementClusterHost { get => _privateCloudUpdateBody.ManagementClusterHost ?? null /* arrayOf */; set => _privateCloudUpdateBody.ManagementClusterHost = value; } + public string[] ManagementClusterHost { get => _privateCloudUpdateBody.ManagementClusterHost?.ToArray() ?? null /* fixedArrayOf */; set => _privateCloudUpdateBody.ManagementClusterHost = (value != null ? new System.Collections.Generic.List(value) : null); } /// The cluster size [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The cluster size")] @@ -241,7 +246,7 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -268,32 +273,32 @@ public partial class UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"Resource tags", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags Tag { get => _privateCloudUpdateBody.Tag ?? null /* object */; set => _privateCloudUpdateBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags Tag { get => _privateCloudUpdateBody.Tag ?? null /* object */; set => _privateCloudUpdateBody.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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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) @@ -337,7 +342,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwarePrivateCl /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -384,11 +393,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -400,10 +434,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -471,7 +521,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -486,7 +536,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.PrivateCloudsUpdateViaIdentity(InputObject.Id, _privateCloudUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.PrivateCloudsUpdateViaIdentity(InputObject.Id, _privateCloudUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -503,13 +553,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.PrivateCloudsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, _privateCloudUpdateBody, onOk, onDefault, this, Pipeline); + await this.Client.PrivateCloudsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, _privateCloudUpdateBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_privateCloudUpdateBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -529,7 +579,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded() { @@ -540,12 +590,12 @@ public UpdateAzVMwarePrivateCloud_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -562,15 +612,15 @@ public UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_privateCloudUpdateBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_privateCloudUpdateBody }) + 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 } }); @@ -580,12 +630,12 @@ public UpdateAzVMwarePrivateCloud_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.VMware.Models.Api20211201.IPrivateCloud + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud /// 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 ) { @@ -597,8 +647,26 @@ public UpdateAzVMwarePrivateCloud_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded.cs index 4342c37ceffc..fb198d6d2039 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update dhcp by id in a private cloud workload network. + /// Update dhcp by id in a private cloud workload network. /// /// [OpenAPI] UpdateDhcp=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDhcp_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update dhcp by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: /// 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; + /// NSX DHCP - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -81,9 +101,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: ReadOnly = false, Description = @"Type of DHCP: SERVER or RELAY.", SerializedName = @"dhcpType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum)""); set => _workloadNetworkDhcpBody.DhcpType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + public string DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? null; set => _workloadNetworkDhcpBody.DhcpType = value; } /// Display name of the DHCP entity. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DHCP entity.")] @@ -96,6 +116,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkDhcpBody.DisplayName ?? null; set => _workloadNetworkDhcpBody.DisplayName = 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] @@ -130,7 +153,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -201,7 +224,8 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -210,24 +234,24 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded : global:: /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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) @@ -275,7 +299,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -322,11 +350,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -338,10 +391,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -409,7 +478,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,12 +491,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksUpdateDhcp(SubscriptionId, ResourceGroupName, PrivateCloudName, DhcpName, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDhcp(SubscriptionId, ResourceGroupName, PrivateCloudName, DhcpName, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DhcpName=DhcpName,body=_workloadNetworkDhcpBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DhcpName=DhcpName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -447,7 +516,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded() { @@ -458,12 +527,12 @@ public UpdateAzVMwareWorkloadNetworkDhcp_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -480,15 +549,15 @@ public UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DhcpName=DhcpName, body=_workloadNetworkDhcpBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DhcpName=DhcpName, body=_workloadNetworkDhcpBody }) + 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 } }); @@ -498,12 +567,12 @@ public UpdateAzVMwareWorkloadNetworkDhcp_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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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 ) { @@ -515,8 +584,26 @@ public UpdateAzVMwareWorkloadNetworkDhcp_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded.cs index 9084cf8973a9..f6c866de9905 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update dhcp by id in a private cloud workload network. + /// Update dhcp by id in a private cloud workload network. /// /// [OpenAPI] UpdateDhcp=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update dhcp by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update dhcp by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded /// 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; + /// NSX DHCP - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDhcp(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -67,9 +87,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded ReadOnly = false, Description = @"Type of DHCP: SERVER or RELAY.", SerializedName = @"dhcpType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum)""); set => _workloadNetworkDhcpBody.DhcpType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + public string DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? null; set => _workloadNetworkDhcpBody.DhcpType = value; } /// Display name of the DHCP entity. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DHCP entity.")] @@ -82,6 +102,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkDhcpBody.DisplayName ?? null; set => _workloadNetworkDhcpBody.DisplayName = 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] @@ -124,7 +147,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -158,24 +181,24 @@ public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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) @@ -221,7 +244,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -268,11 +295,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -284,10 +336,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -355,7 +423,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -370,7 +438,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkloadNetworksUpdateDhcpViaIdentity(InputObject.Id, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDhcpViaIdentity(InputObject.Id, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -391,13 +459,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DhcpId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkloadNetworksUpdateDhcp(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DhcpId ?? null, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDhcp(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DhcpId ?? null, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkDhcpBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +485,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded() { @@ -428,12 +496,12 @@ public UpdateAzVMwareWorkloadNetworkDhcp_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -450,15 +518,15 @@ public UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkDhcpBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_workloadNetworkDhcpBody }) + 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 } }); @@ -468,12 +536,12 @@ public UpdateAzVMwareWorkloadNetworkDhcp_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.VMware.Models.Api20211201.IWorkloadNetworkDhcp + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp /// 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 ) { @@ -485,8 +553,26 @@ public UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..774dec4d47fd --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,592 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update dhcp by id in a private cloud workload network. + /// + /// [OpenAPI] UpdateDhcp=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update dhcp by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dhcpConfigurations/{dhcpId}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DHCP + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp _workloadNetworkDhcpBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDhcp(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _dhcpName; + + /// NSX DHCP identifier. Generally the same as the DHCP display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DHCP identifier. Generally the same as the DHCP display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DHCP identifier. Generally the same as the DHCP display name", + SerializedName = @"dhcpId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DhcpName { get => this._dhcpName; set => this._dhcpName = value; } + + /// Type of DHCP: SERVER or RELAY. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of DHCP: SERVER or RELAY.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of DHCP: SERVER or RELAY.", + SerializedName = @"dhcpType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] + public string DhcpType { get => _workloadNetworkDhcpBody.DhcpType ?? null; set => _workloadNetworkDhcpBody.DhcpType = value; } + + /// Display name of the DHCP entity. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DHCP entity.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DHCP entity.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDhcpBody.DisplayName ?? null; set => _workloadNetworkDhcpBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDhcpBody.Revision ?? default(long); set => _workloadNetworkDhcpBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDhcpBody = this._workloadNetworkDhcpBody; + clone.DhcpName = this.DhcpName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksUpdateDhcp' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dhcpConfigurations/{(global::System.Uri.EscapeDataString(this.DhcpName.ToString()))}"; + await this.Client.WorkloadNetworksUpdateDhcpViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksUpdateDhcp(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DhcpName, _workloadNetworkDhcpBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DhcpName=DhcpName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDhcp + /// 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.VMware.Models.IWorkloadNetworkDhcp + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded.cs index fce297dc6daf..ba716106115f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a DNS service by id in a private cloud workload network. + /// Update a DNS service by id in a private cloud workload network. /// /// [OpenAPI] UpdateDnsService=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDnsService_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a DNS service by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl /// 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; + /// NSX DNS Service - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,9 +81,10 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl public string DefaultDnsZone { get => _workloadNetworkDnsServiceBody.DefaultDnsZone ?? null; set => _workloadNetworkDnsServiceBody.DefaultDnsZone = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -108,6 +128,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// FQDN zones of the DNS Service. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "FQDN zones of the DNS Service.")] @@ -118,7 +141,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl Description = @"FQDN zones of the DNS Service.", SerializedName = @"fqdnZones", PossibleTypes = new [] { typeof(string) })] - public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone ?? null /* arrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = value; } + public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -143,9 +166,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl ReadOnly = false, Description = @"DNS Service log level.", SerializedName = @"logLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum)""); set => _workloadNetworkDnsServiceBody.LogLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + public string LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? null; set => _workloadNetworkDnsServiceBody.LogLevel = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -166,7 +189,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -237,7 +260,8 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -246,24 +270,24 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded : gl /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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) @@ -311,7 +335,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -358,11 +386,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -374,10 +427,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -445,7 +514,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -458,12 +527,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksUpdateDnsService(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsServiceName, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDnsService(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsServiceName, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DnsServiceName=DnsServiceName,body=_workloadNetworkDnsServiceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DnsServiceName=DnsServiceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -483,7 +552,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded() { @@ -494,12 +563,12 @@ public UpdateAzVMwareWorkloadNetworkDnsService_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -516,15 +585,15 @@ public UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsServiceName=DnsServiceName, body=_workloadNetworkDnsServiceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsServiceName=DnsServiceName, body=_workloadNetworkDnsServiceBody }) + 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 } }); @@ -534,12 +603,12 @@ public UpdateAzVMwareWorkloadNetworkDnsService_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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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 ) { @@ -551,8 +620,26 @@ public UpdateAzVMwareWorkloadNetworkDnsService_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded.cs index 0c874a7edd33..6a719ec91be0 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a DNS service by id in a private cloud workload network. + /// Update a DNS service by id in a private cloud workload network. /// /// [OpenAPI] UpdateDnsService=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a DNS service by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a DNS service by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx /// 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; + /// NSX DNS Service - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsService(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,9 +81,10 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx public string DefaultDnsZone { get => _workloadNetworkDnsServiceBody.DefaultDnsZone ?? null; set => _workloadNetworkDnsServiceBody.DefaultDnsZone = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -92,6 +112,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx PossibleTypes = new [] { typeof(string) })] public string DnsServiceIP { get => _workloadNetworkDnsServiceBody.DnsServiceIP ?? null; set => _workloadNetworkDnsServiceBody.DnsServiceIP = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// FQDN zones of the DNS Service. [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "FQDN zones of the DNS Service.")] @@ -102,7 +125,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx Description = @"FQDN zones of the DNS Service.", SerializedName = @"fqdnZones", PossibleTypes = new [] { typeof(string) })] - public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone ?? null /* arrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = value; } + public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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")] @@ -135,9 +158,9 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx ReadOnly = false, Description = @"DNS Service log level.", SerializedName = @"logLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum)""); set => _workloadNetworkDnsServiceBody.LogLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + public string LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? null; set => _workloadNetworkDnsServiceBody.LogLevel = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -158,7 +181,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -192,24 +215,24 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityEx /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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) @@ -255,7 +278,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -302,11 +329,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -318,10 +370,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -389,7 +457,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +472,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkloadNetworksUpdateDnsServiceViaIdentity(InputObject.Id, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDnsServiceViaIdentity(InputObject.Id, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -425,13 +493,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DnsServiceId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkloadNetworksUpdateDnsService(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DnsServiceId ?? null, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDnsService(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DnsServiceId ?? null, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkDnsServiceBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -451,7 +519,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded() @@ -463,12 +531,12 @@ public UpdateAzVMwareWorkloadNetworkDnsService_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -485,15 +553,15 @@ public UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkDnsServiceBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_workloadNetworkDnsServiceBody }) + 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 } }); @@ -503,12 +571,12 @@ public UpdateAzVMwareWorkloadNetworkDnsService_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.VMware.Models.Api20211201.IWorkloadNetworkDnsService + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService /// 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 ) { @@ -520,8 +588,26 @@ public UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..31e940bb1951 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,628 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a DNS service by id in a private cloud workload network. + /// + /// [OpenAPI] UpdateDnsService=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a DNS service by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsServices/{dnsServiceId}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DNS Service + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService _workloadNetworkDnsServiceBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsService(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Default DNS zone of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Default DNS zone of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default DNS zone of the DNS Service.", + SerializedName = @"defaultDnsZone", + PossibleTypes = new [] { typeof(string) })] + public string DefaultDnsZone { get => _workloadNetworkDnsServiceBody.DefaultDnsZone ?? null; set => _workloadNetworkDnsServiceBody.DefaultDnsZone = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DNS Service.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDnsServiceBody.DisplayName ?? null; set => _workloadNetworkDnsServiceBody.DisplayName = value; } + + /// DNS service IP of the DNS Service. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS service IP of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS service IP of the DNS Service.", + SerializedName = @"dnsServiceIp", + PossibleTypes = new [] { typeof(string) })] + public string DnsServiceIP { get => _workloadNetworkDnsServiceBody.DnsServiceIP ?? null; set => _workloadNetworkDnsServiceBody.DnsServiceIP = value; } + + /// Backing field for property. + private string _dnsServiceName; + + /// + /// NSX DNS Service identifier. Generally the same as the DNS Service's display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DNS Service identifier. Generally the same as the DNS Service's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DNS Service identifier. Generally the same as the DNS Service's display name", + SerializedName = @"dnsServiceId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DnsServiceName { get => this._dnsServiceName; set => this._dnsServiceName = value; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// FQDN zones of the DNS Service. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "FQDN zones of the DNS Service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"FQDN zones of the DNS Service.", + SerializedName = @"fqdnZones", + PossibleTypes = new [] { typeof(string) })] + public string[] FqdnZone { get => _workloadNetworkDnsServiceBody.FqdnZone?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsServiceBody.FqdnZone = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// DNS Service log level. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS Service log level.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS Service log level.", + SerializedName = @"logLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] + public string LogLevel { get => _workloadNetworkDnsServiceBody.LogLevel ?? null; set => _workloadNetworkDnsServiceBody.LogLevel = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDnsServiceBody.Revision ?? default(long); set => _workloadNetworkDnsServiceBody.Revision = 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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDnsServiceBody = this._workloadNetworkDnsServiceBody; + clone.DnsServiceName = this.DnsServiceName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksUpdateDnsService' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dnsServices/{(global::System.Uri.EscapeDataString(this.DnsServiceName.ToString()))}"; + await this.Client.WorkloadNetworksUpdateDnsServiceViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksUpdateDnsService(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DnsServiceName, _workloadNetworkDnsServiceBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DnsServiceName=DnsServiceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsService + /// 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.VMware.Models.IWorkloadNetworkDnsService + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded.cs index 0acc40f5fc20..d3e6ce52322f 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a DNS zone by id in a private cloud workload network. + /// Update a DNS zone by id in a private cloud workload network. /// /// [OpenAPI] UpdateDnsZone=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDnsZone_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a DNS zone by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa /// 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; + /// NSX DNS Zone - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -80,7 +100,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa Description = @"DNS Server IP array of the DNS Zone.", SerializedName = @"dnsServerIps", PossibleTypes = new [] { typeof(string) })] - public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP ?? null /* arrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = value; } + public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = (value != null ? new System.Collections.Generic.List(value) : null); } /// Number of DNS Services using the DNS zone. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of DNS Services using the DNS zone.")] @@ -117,7 +137,10 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa Description = @"Domain names of the DNS Zone.", SerializedName = @"domain", PossibleTypes = new [] { typeof(string) })] - public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain ?? null /* arrayOf */; set => _workloadNetworkDnsZoneBody.Domain = value; } + public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.Domain = (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")] @@ -153,7 +176,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -235,7 +258,8 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -244,24 +268,24 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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) @@ -309,7 +333,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -356,11 +384,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -372,10 +425,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -443,7 +512,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -456,12 +525,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksUpdateDnsZone(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsZoneName, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDnsZone(SubscriptionId, ResourceGroupName, PrivateCloudName, DnsZoneName, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,DnsZoneName=DnsZoneName,body=_workloadNetworkDnsZoneBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,DnsZoneName=DnsZoneName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -481,7 +550,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded() { @@ -492,12 +561,12 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -514,15 +583,15 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsZoneName=DnsZoneName, body=_workloadNetworkDnsZoneBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, DnsZoneName=DnsZoneName, body=_workloadNetworkDnsZoneBody }) + 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 } }); @@ -532,12 +601,12 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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 ) { @@ -549,8 +618,26 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded.cs index 566ffde36e48..b75800a855ef 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a DNS zone by id in a private cloud workload network. + /// Update a DNS zone by id in a private cloud workload network. /// /// [OpenAPI] UpdateDnsZone=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a DNS zone by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a DNS zone by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpan /// 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; + /// NSX DNS Zone - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkDnsZone(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -80,7 +100,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpan Description = @"DNS Server IP array of the DNS Zone.", SerializedName = @"dnsServerIps", PossibleTypes = new [] { typeof(string) })] - public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP ?? null /* arrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = value; } + public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = (value != null ? new System.Collections.Generic.List(value) : null); } /// Number of DNS Services using the DNS zone. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of DNS Services using the DNS zone.")] @@ -103,7 +123,10 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpan Description = @"Domain names of the DNS Zone.", SerializedName = @"domain", PossibleTypes = new [] { typeof(string) })] - public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain ?? null /* arrayOf */; set => _workloadNetworkDnsZoneBody.Domain = value; } + public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.Domain = (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")] @@ -147,7 +170,7 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -192,24 +215,24 @@ public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpan /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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) @@ -255,7 +278,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -302,11 +329,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -318,10 +370,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -389,7 +457,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -404,7 +472,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkloadNetworksUpdateDnsZoneViaIdentity(InputObject.Id, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDnsZoneViaIdentity(InputObject.Id, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -425,13 +493,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DnsZoneId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkloadNetworksUpdateDnsZone(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DnsZoneId ?? null, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateDnsZone(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.DnsZoneId ?? null, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkDnsZoneBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -451,7 +519,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded() @@ -463,12 +531,12 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -485,15 +553,15 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkDnsZoneBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_workloadNetworkDnsZoneBody }) + 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 } }); @@ -503,12 +571,12 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_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.VMware.Models.Api20211201.IWorkloadNetworkDnsZone + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone /// 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 ) { @@ -520,8 +588,26 @@ public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..1fe7190c55c4 --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,626 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a DNS zone by id in a private cloud workload network. + /// + /// [OpenAPI] UpdateDnsZone=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a DNS zone by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/dnsZones/{dnsZoneId}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX DNS Zone + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone _workloadNetworkDnsZoneBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkDnsZone(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the DNS Zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the DNS Zone.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkDnsZoneBody.DisplayName ?? null; set => _workloadNetworkDnsZoneBody.DisplayName = value; } + + /// DNS Server IP array of the DNS Zone. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DNS Server IP array of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DNS Server IP array of the DNS Zone.", + SerializedName = @"dnsServerIps", + PossibleTypes = new [] { typeof(string) })] + public string[] DnsServerIP { get => _workloadNetworkDnsZoneBody.DnsServerIP?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.DnsServerIP = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Number of DNS Services using the DNS zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of DNS Services using the DNS zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Number of DNS Services using the DNS zone.", + SerializedName = @"dnsServices", + PossibleTypes = new [] { typeof(long) })] + public long DnsService { get => _workloadNetworkDnsZoneBody.DnsService ?? default(long); set => _workloadNetworkDnsZoneBody.DnsService = value; } + + /// Backing field for property. + private string _dnsZoneName; + + /// NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX DNS Zone identifier. Generally the same as the DNS Zone's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX DNS Zone identifier. Generally the same as the DNS Zone's display name", + SerializedName = @"dnsZoneId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string DnsZoneName { get => this._dnsZoneName; set => this._dnsZoneName = value; } + + /// Domain names of the DNS Zone. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Domain names of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Domain names of the DNS Zone.", + SerializedName = @"domain", + PossibleTypes = new [] { typeof(string) })] + public string[] Domain { get => _workloadNetworkDnsZoneBody.Domain?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkDnsZoneBody.Domain = (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")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkDnsZoneBody.Revision ?? default(long); set => _workloadNetworkDnsZoneBody.Revision = value; } + + /// Source IP of the DNS Zone. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source IP of the DNS Zone.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source IP of the DNS Zone.", + SerializedName = @"sourceIp", + PossibleTypes = new [] { typeof(string) })] + public string SourceIP { get => _workloadNetworkDnsZoneBody.SourceIP ?? null; set => _workloadNetworkDnsZoneBody.SourceIP = 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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkDnsZoneBody = this._workloadNetworkDnsZoneBody; + clone.DnsZoneName = this.DnsZoneName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksUpdateDnsZone' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/dnsZones/{(global::System.Uri.EscapeDataString(this.DnsZoneName.ToString()))}"; + await this.Client.WorkloadNetworksUpdateDnsZoneViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksUpdateDnsZone(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, DnsZoneName, _workloadNetworkDnsZoneBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { DnsZoneName=DnsZoneName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkDnsZone + /// 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.VMware.Models.IWorkloadNetworkDnsZone + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded.cs index 289145cdfc51..4a5b9cfce199 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded.cs @@ -6,21 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// - /// Create or update a port mirroring profile by id in a private cloud workload network. - /// + /// Update a port mirroring profile by id in a private cloud workload network. /// /// [OpenAPI] UpdatePortMirroring=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkPortMirroring_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a port mirroring profile by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : /// 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; + /// NSX Port Mirroring - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -80,9 +98,9 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : ReadOnly = false, Description = @"Direction of port mirroring profile.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum Direction { get => _workloadNetworkPortMirroringBody.Direction ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum)""); set => _workloadNetworkPortMirroringBody.Direction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + public string Direction { get => _workloadNetworkPortMirroringBody.Direction ?? null; set => _workloadNetworkPortMirroringBody.Direction = value; } /// Display name of the port mirroring profile. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the port mirroring profile.")] @@ -95,6 +113,9 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkPortMirroringBody.DisplayName ?? null; set => _workloadNetworkPortMirroringBody.DisplayName = 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] @@ -129,7 +150,7 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _portMirroringName; @@ -227,7 +248,8 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -236,24 +258,24 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded : /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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) @@ -303,7 +325,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -350,11 +376,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -366,10 +417,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -437,7 +504,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -450,12 +517,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksUpdatePortMirroring(SubscriptionId, ResourceGroupName, PrivateCloudName, PortMirroringName, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdatePortMirroring(SubscriptionId, ResourceGroupName, PrivateCloudName, PortMirroringName, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,PortMirroringName=PortMirroringName,body=_workloadNetworkPortMirroringBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,PortMirroringName=PortMirroringName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -475,7 +542,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded() { @@ -486,12 +553,12 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -508,15 +575,15 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PortMirroringName=PortMirroringName, body=_workloadNetworkPortMirroringBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, PortMirroringName=PortMirroringName, body=_workloadNetworkPortMirroringBody }) + 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 } }); @@ -526,12 +593,12 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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 ) { @@ -543,8 +610,26 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded.cs index c19c2cf4f740..0817b9772e08 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded.cs @@ -6,21 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// - /// Create or update a port mirroring profile by id in a private cloud workload network. - /// + /// Update a port mirroring profile by id in a private cloud workload network. /// /// [OpenAPI] UpdatePortMirroring=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a port mirroring profile by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a port mirroring profile by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentit /// 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; + /// NSX Port Mirroring - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkPortMirroring(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -80,9 +98,9 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentit ReadOnly = false, Description = @"Direction of port mirroring profile.", SerializedName = @"direction", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum))] - public Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum Direction { get => _workloadNetworkPortMirroringBody.Direction ?? ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum)""); set => _workloadNetworkPortMirroringBody.Direction = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + public string Direction { get => _workloadNetworkPortMirroringBody.Direction ?? null; set => _workloadNetworkPortMirroringBody.Direction = value; } /// Display name of the port mirroring profile. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the port mirroring profile.")] @@ -95,6 +113,9 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentit PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkPortMirroringBody.DisplayName ?? null; set => _workloadNetworkPortMirroringBody.DisplayName = 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] @@ -137,7 +158,7 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -182,24 +203,24 @@ public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentit /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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) @@ -245,7 +266,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -292,11 +317,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -308,10 +358,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -379,7 +445,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -394,7 +460,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkloadNetworksUpdatePortMirroringViaIdentity(InputObject.Id, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdatePortMirroringViaIdentity(InputObject.Id, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -415,13 +481,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PortMirroringId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkloadNetworksUpdatePortMirroring(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.PortMirroringId ?? null, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdatePortMirroring(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.PortMirroringId ?? null, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkPortMirroringBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -441,8 +507,8 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet - /// class. + /// Initializes a new instance of the + /// cmdlet class. /// public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded() { @@ -453,12 +519,12 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -475,15 +541,15 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkPortMirroringBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_workloadNetworkPortMirroringBody }) + 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 } }); @@ -493,12 +559,12 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_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.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring /// 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 ) { @@ -510,8 +576,26 @@ public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..0c18c8e9c71f --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,616 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a port mirroring profile by id in a private cloud workload network. + /// + /// [OpenAPI] UpdatePortMirroring=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a port mirroring profile by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/portMirroringProfiles/{portMirroringId}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Port Mirroring + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring _workloadNetworkPortMirroringBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkPortMirroring(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Destination VM Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Destination VM Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Destination VM Group.", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + public string Destination { get => _workloadNetworkPortMirroringBody.Destination ?? null; set => _workloadNetworkPortMirroringBody.Destination = value; } + + /// Direction of port mirroring profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Direction of port mirroring profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Direction of port mirroring profile.", + SerializedName = @"direction", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] + public string Direction { get => _workloadNetworkPortMirroringBody.Direction ?? null; set => _workloadNetworkPortMirroringBody.Direction = value; } + + /// Display name of the port mirroring profile. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the port mirroring profile.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the port mirroring profile.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkPortMirroringBody.DisplayName ?? null; set => _workloadNetworkPortMirroringBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private string _portMirroringName; + + /// + /// NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name", + SerializedName = @"portMirroringId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string PortMirroringName { get => this._portMirroringName; set => this._portMirroringName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkPortMirroringBody.Revision ?? default(long); set => _workloadNetworkPortMirroringBody.Revision = value; } + + /// Source VM Group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Source VM Group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Source VM Group.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(string) })] + public string Source { get => _workloadNetworkPortMirroringBody.Source ?? null; set => _workloadNetworkPortMirroringBody.Source = 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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkPortMirroringBody = this._workloadNetworkPortMirroringBody; + clone.PortMirroringName = this.PortMirroringName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksUpdatePortMirroring' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/portMirroringProfiles/{(global::System.Uri.EscapeDataString(this.PortMirroringName.ToString()))}"; + await this.Client.WorkloadNetworksUpdatePortMirroringViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksUpdatePortMirroring(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, PortMirroringName, _workloadNetworkPortMirroringBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { PortMirroringName=PortMirroringName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkPortMirroring + /// 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.VMware.Models.IWorkloadNetworkPortMirroring + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded.cs index c020b5fd4818..476f4eb8debd 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a segment by id in a private cloud workload network. + /// Update a segment by id in a private cloud workload network. /// /// [OpenAPI] UpdateSegments=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkSegment_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a segment by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa /// 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; + /// NSX Segment - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,9 +81,10 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa public string ConnectedGateway { get => _workloadNetworkSegmentBody.ConnectedGateway ?? null; set => _workloadNetworkSegmentBody.ConnectedGateway = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -81,6 +101,9 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkSegmentBody.DisplayName ?? null; set => _workloadNetworkSegmentBody.DisplayName = 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] @@ -115,7 +138,7 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -196,7 +219,7 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa Description = @"DHCP Range assigned for subnet.", SerializedName = @"dhcpRanges", PossibleTypes = new [] { typeof(string) })] - public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange ?? null /* arrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = value; } + public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = (value != null ? new System.Collections.Generic.List(value) : null); } /// Gateway address. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway address.")] @@ -223,7 +246,8 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -232,24 +256,24 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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) @@ -297,7 +321,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -344,11 +372,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -360,10 +413,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -431,7 +500,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,12 +513,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksUpdateSegments(SubscriptionId, ResourceGroupName, PrivateCloudName, SegmentName, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateSegments(SubscriptionId, ResourceGroupName, PrivateCloudName, SegmentName, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName,body=_workloadNetworkSegmentBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,SegmentName=SegmentName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -469,7 +538,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded() { @@ -480,12 +549,12 @@ public UpdateAzVMwareWorkloadNetworkSegment_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -502,15 +571,15 @@ public UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName, body=_workloadNetworkSegmentBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, SegmentName=SegmentName, body=_workloadNetworkSegmentBody }) + 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 } }); @@ -520,12 +589,12 @@ public UpdateAzVMwareWorkloadNetworkSegment_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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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 ) { @@ -537,8 +606,26 @@ public UpdateAzVMwareWorkloadNetworkSegment_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded.cs index 727f006f45ec..491a5d5f43d9 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a segment by id in a private cloud workload network. + /// Update a segment by id in a private cloud workload network. /// /// [OpenAPI] UpdateSegments=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a segment by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a segment by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan /// 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; + /// NSX Segment - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkSegment(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +63,9 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; @@ -62,9 +81,10 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan public string ConnectedGateway { get => _workloadNetworkSegmentBody.ConnectedGateway ?? null; set => _workloadNetworkSegmentBody.ConnectedGateway = value; } /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -81,6 +101,9 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkSegmentBody.DisplayName ?? null; set => _workloadNetworkSegmentBody.DisplayName = 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] @@ -123,7 +146,7 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -162,7 +185,7 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan Description = @"DHCP Range assigned for subnet.", SerializedName = @"dhcpRanges", PossibleTypes = new [] { typeof(string) })] - public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange ?? null /* arrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = value; } + public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = (value != null ? new System.Collections.Generic.List(value) : null); } /// Gateway address. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway address.")] @@ -180,24 +203,24 @@ public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpan /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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) @@ -243,7 +266,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -290,11 +317,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -306,10 +358,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -377,7 +445,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -392,7 +460,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkloadNetworksUpdateSegmentsViaIdentity(InputObject.Id, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateSegmentsViaIdentity(InputObject.Id, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -413,13 +481,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SegmentId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkloadNetworksUpdateSegments(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.SegmentId ?? null, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateSegments(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.SegmentId ?? null, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkSegmentBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -439,7 +507,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded() @@ -451,12 +519,12 @@ public UpdateAzVMwareWorkloadNetworkSegment_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -473,15 +541,15 @@ public UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkSegmentBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_workloadNetworkSegmentBody }) + 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 } }); @@ -491,12 +559,12 @@ public UpdateAzVMwareWorkloadNetworkSegment_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.VMware.Models.Api20211201.IWorkloadNetworkSegment + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment /// 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 ) { @@ -508,8 +576,26 @@ public UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..26db139a494d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,614 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a segment by id in a private cloud workload network. + /// + /// [OpenAPI] UpdateSegments=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a segment by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/segments/{segmentId}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX Segment + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment _workloadNetworkSegmentBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkSegment(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; + + /// Gateway which to connect segment to. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway which to connect segment to.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway which to connect segment to.", + SerializedName = @"connectedGateway", + PossibleTypes = new [] { typeof(string) })] + public string ConnectedGateway { get => _workloadNetworkSegmentBody.ConnectedGateway ?? null; set => _workloadNetworkSegmentBody.ConnectedGateway = 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the segment. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the segment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the segment.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkSegmentBody.DisplayName ?? null; set => _workloadNetworkSegmentBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkSegmentBody.Revision ?? default(long); set => _workloadNetworkSegmentBody.Revision = value; } + + /// Backing field for property. + private string _segmentName; + + /// NSX Segment identifier. Generally the same as the Segment's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX Segment identifier. Generally the same as the Segment's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX Segment identifier. Generally the same as the Segment's display name", + SerializedName = @"segmentId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string SegmentName { get => this._segmentName; set => this._segmentName = value; } + + /// DHCP Range assigned for subnet. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "DHCP Range assigned for subnet.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DHCP Range assigned for subnet.", + SerializedName = @"dhcpRanges", + PossibleTypes = new [] { typeof(string) })] + public string[] SubnetDhcpRange { get => _workloadNetworkSegmentBody.SubnetDhcpRange?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkSegmentBody.SubnetDhcpRange = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Gateway address. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gateway address.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gateway address.", + SerializedName = @"gatewayAddress", + PossibleTypes = new [] { typeof(string) })] + public string SubnetGatewayAddress { get => _workloadNetworkSegmentBody.SubnetGatewayAddress ?? null; set => _workloadNetworkSegmentBody.SubnetGatewayAddress = 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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkSegmentBody = this._workloadNetworkSegmentBody; + clone.SegmentName = this.SegmentName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksUpdateSegments' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/segments/{(global::System.Uri.EscapeDataString(this.SegmentName.ToString()))}"; + await this.Client.WorkloadNetworksUpdateSegmentsViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksUpdateSegments(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, SegmentName, _workloadNetworkSegmentBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SegmentName=SegmentName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkSegment + /// 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.VMware.Models.IWorkloadNetworkSegment + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded.cs index de0225231a80..713b7833f535 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a vm group by id in a private cloud workload network. + /// Update a vm group by id in a private cloud workload network. /// /// [OpenAPI] UpdateVMGroup=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkVMGroup_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a vm group by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa /// 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; + /// NSX VM Group - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -70,6 +90,9 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkVMGroupBody.DisplayName ?? null; set => _workloadNetworkVMGroupBody.DisplayName = 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] @@ -95,7 +118,7 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa Description = @"Virtual machine members of this group.", SerializedName = @"members", PossibleTypes = new [] { typeof(string) })] - public string[] Member { get => _workloadNetworkVMGroupBody.Member ?? null /* arrayOf */; set => _workloadNetworkVMGroupBody.Member = value; } + public string[] Member { get => _workloadNetworkVMGroupBody.Member?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkVMGroupBody.Member = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -116,7 +139,7 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } /// Backing field for property. private string _privateCloudName; @@ -187,7 +210,8 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -210,24 +234,24 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded : globa /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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) @@ -275,7 +299,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -322,11 +350,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -338,10 +391,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -409,7 +478,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,12 +491,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.WorkloadNetworksUpdateVMGroup(SubscriptionId, ResourceGroupName, PrivateCloudName, VMGroupName, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateVMGroup(SubscriptionId, ResourceGroupName, PrivateCloudName, VMGroupName, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.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,PrivateCloudName=PrivateCloudName,VMGroupName=VMGroupName,body=_workloadNetworkVMGroupBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,PrivateCloudName=PrivateCloudName,VMGroupName=VMGroupName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -447,7 +516,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded() { @@ -458,12 +527,12 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -480,15 +549,15 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VMGroupName=VMGroupName, body=_workloadNetworkVMGroupBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, PrivateCloudName=PrivateCloudName, VMGroupName=VMGroupName, body=_workloadNetworkVMGroupBody }) + 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 } }); @@ -498,12 +567,12 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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 ) { @@ -515,8 +584,26 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded.cs index 8219563ef829..3edf22ffbf52 100644 --- a/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded.cs +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded.cs @@ -6,19 +6,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; using System; - /// Create or update a vm group by id in a private cloud workload network. + /// Update a vm group by id in a private cloud workload network. /// /// [OpenAPI] UpdateVMGroup=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" /// [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup))] - [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Create or update a vm group by id in a private cloud workload network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a vm group by id in a private cloud workload network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,8 +38,20 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpan /// 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; + /// NSX VM Group - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.WorkloadNetworkVMGroup(); + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,13 +63,17 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.ClientAPI; /// - /// The credentials, account, tenant, and subscription used for communication with Azure + /// 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 credentials, account, tenant, and subscription used for communication with Azure.")] + [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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] @@ -70,6 +90,9 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpan PossibleTypes = new [] { typeof(string) })] public string DisplayName { get => _workloadNetworkVMGroupBody.DisplayName ?? null; set => _workloadNetworkVMGroupBody.DisplayName = 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] @@ -103,7 +126,7 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpan Description = @"Virtual machine members of this group.", SerializedName = @"members", PossibleTypes = new [] { typeof(string) })] - public string[] Member { get => _workloadNetworkVMGroupBody.Member ?? null /* arrayOf */; set => _workloadNetworkVMGroupBody.Member = value; } + public string[] Member { get => _workloadNetworkVMGroupBody.Member?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkVMGroupBody.Member = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -124,7 +147,7 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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")] @@ -158,24 +181,24 @@ public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpan /// 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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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) @@ -221,7 +244,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadN /// Performs clean-up after the command execution protected override void EndProcessing() { - + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } } /// Handles/Dispatches events during the call to the REST service. @@ -268,11 +295,36 @@ 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.VMware.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -284,10 +336,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -355,7 +423,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -370,7 +438,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.WorkloadNetworksUpdateVMGroupViaIdentity(InputObject.Id, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateVMGroupViaIdentity(InputObject.Id, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } else { @@ -391,13 +459,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VMGroupId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.WorkloadNetworksUpdateVMGroup(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.VMGroupId ?? null, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline); + await this.Client.WorkloadNetworksUpdateVMGroup(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.PrivateCloudName ?? null, InputObject.VMGroupId ?? null, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkVMGroupBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -417,7 +485,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded() @@ -429,12 +497,12 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_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.VMware.Models.Api20211201.ICloudError + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.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 ) { @@ -451,15 +519,15 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_workloadNetworkVMGroupBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.VMware.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 { body=_workloadNetworkVMGroupBody }) + 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 } }); @@ -469,12 +537,12 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_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.VMware.Models.Api20211201.IWorkloadNetworkVMGroup + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup /// 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 ) { @@ -486,8 +554,26 @@ public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded.cs b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded.cs new file mode 100644 index 000000000000..cbc9d12a059d --- /dev/null +++ b/src/VMware/VMware.Autorest/generated/cmdlets/UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded.cs @@ -0,0 +1,592 @@ +// 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.VMware.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Cmdlets; + using System; + + /// Update a vm group by id in a private cloud workload network. + /// + /// [OpenAPI] UpdateVMGroup=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup))] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Description(@"Update a vm group by id in a private cloud workload network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/workloadNetworks/default/vmGroups/{vmGroupId}", ApiVersion = "2023-03-01")] + public partial class UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.VMware.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; + + /// NSX VM Group + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup _workloadNetworkVMGroupBody = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.WorkloadNetworkVMGroup(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.VMware Client => Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Display name of the VM group. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Display name of the VM group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of the VM group.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + public string DisplayName { get => _workloadNetworkVMGroupBody.DisplayName ?? null; set => _workloadNetworkVMGroupBody.DisplayName = 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] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.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; } } + + /// Virtual machine members of this group. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Virtual machine members of this group.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Virtual machine members of this group.", + SerializedName = @"members", + PossibleTypes = new [] { typeof(string) })] + public string[] Member { get => _workloadNetworkVMGroupBody.Member?.ToArray() ?? null /* fixedArrayOf */; set => _workloadNetworkVMGroupBody.Member = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.HttpPipeline Pipeline { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity _privateCloudInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity PrivateCloudInputObject { get => this._privateCloudInputObject; set => this._privateCloudInputObject = value; } + + /// 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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// NSX revision number. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NSX revision number.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NSX revision number.", + SerializedName = @"revision", + PossibleTypes = new [] { typeof(long) })] + public long Revision { get => _workloadNetworkVMGroupBody.Revision ?? default(long); set => _workloadNetworkVMGroupBody.Revision = value; } + + /// Backing field for property. + private string _vMGroupName; + + /// NSX VM Group identifier. Generally the same as the VM Group's display name + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "NSX VM Group identifier. Generally the same as the VM Group's display name")] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"NSX VM Group identifier. Generally the same as the VM Group's display name", + SerializedName = @"vmGroupId", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.VMware.Category(global::Microsoft.Azure.PowerShell.Cmdlets.VMware.ParameterCategory.Path)] + public string VMGroupName { get => this._vMGroupName; set => this._vMGroupName = 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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.VMware.Cmdlets.UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded Clone() + { + var clone = new UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._workloadNetworkVMGroupBody = this._workloadNetworkVMGroupBody; + clone.VMGroupName = this.VMGroupName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + } + + /// 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.VMware.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.VMware.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'WorkloadNetworksUpdateVMGroup' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.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.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.VMware.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (PrivateCloudInputObject?.Id != null) + { + this.PrivateCloudInputObject.Id += $"/vmGroups/{(global::System.Uri.EscapeDataString(this.VMGroupName.ToString()))}"; + await this.Client.WorkloadNetworksUpdateVMGroupViaIdentity(PrivateCloudInputObject.Id, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == PrivateCloudInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + if (null == PrivateCloudInputObject.PrivateCloudName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("PrivateCloudInputObject has null value for PrivateCloudInputObject.PrivateCloudName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, PrivateCloudInputObject) ); + } + await this.Client.WorkloadNetworksUpdateVMGroup(PrivateCloudInputObject.SubscriptionId ?? null, PrivateCloudInputObject.ResourceGroupName ?? null, PrivateCloudInputObject.PrivateCloudName ?? null, VMGroupName, _workloadNetworkVMGroupBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { VMGroupName=VMGroupName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded() + { + + } + + /// + /// 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.VMware.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.VMware.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.VMware.Models.IWorkloadNetworkVMGroup + /// 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.VMware.Models.IWorkloadNetworkVMGroup + 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/src/VMware/VMware.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/src/VMware/VMware.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..4a5b6a37defb --- /dev/null +++ b/src/VMware/VMware.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.VMware +{ + 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/src/VMware/VMware.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/src/VMware/VMware.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..590ea027ad24 --- /dev/null +++ b/src/VMware/VMware.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.VMware +{ + 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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index fbda057b7981..11c2a9572714 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/src/VMware/VMware.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.VMware.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.VMware.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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs index e73577144734..4c1d27238664 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -33,6 +33,9 @@ public class ExportHelpMarkdown : PSCmdlet [ValidateNotNullOrEmpty] public string ExamplesFolder { get; set; } + [Parameter()] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -41,7 +44,7 @@ protected override void ProcessRecord() var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); - WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder, AddComplexInterfaceInfo.IsPresent); } catch (Exception ee) { diff --git a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index ae0493a4651b..d62f1c41e66f 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/src/VMware/VMware.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.VMware.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.VMware.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 961372acaa4a..6fc4de170d2d 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -52,6 +52,9 @@ public class ExportProxyCmdlet : PSCmdlet [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] public SwitchParameter ExcludeDocs { get; set; } + [Parameter(ParameterSetName = "Docs")] + public SwitchParameter AddComplexInterfaceInfo { get; set; } + protected override void ProcessRecord() { try @@ -163,7 +166,7 @@ protected override void ProcessRecord() var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; - WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder, AddComplexInterfaceInfo.IsPresent); } } } diff --git a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 979509695771..354626629bc9 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index ebce6b879dd7..c11d00256db3 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -56,6 +56,31 @@ protected override void ProcessRecord() 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 diff --git a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 12501c8e022a..402ded6a38b5 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.PowerShell { internal static class MarkdownRenderer { - public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder, bool AddComplexInterfaceInfo = true) { Directory.CreateDirectory(docsFolder); var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); @@ -69,18 +69,26 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod } sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); - sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); - foreach (var alias in markdownInfo.Aliases) + if (markdownInfo.Aliases.Any()) { - sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); } - if (markdownInfo.ComplexInterfaceInfos.Any()) + foreach (var alias in markdownInfo.Aliases) { - sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); } - foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + + if (AddComplexInterfaceInfo) { - sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + } sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); diff --git a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index ae92c9d7b171..7968acf84038 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 64010a05ae04..f071118fa719 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/src/VMware/VMware.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; } @@ -191,15 +206,22 @@ public BeginOutput(VariantGroup variantGroup) : base(variantGroup) public string GetProcessCustomAttributesAtRuntime() { - return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + return VariantGroup.IsInternal ? "" : IsAzure ? $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet] +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) +{Indent}{Indent}}}" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) { return $@" {Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ -{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() {Indent}{Indent}}} {Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId {Indent}{Indent}if ($preTelemetryId -eq '') {{ @@ -262,7 +284,12 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } + 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}}}"); } @@ -357,6 +384,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) { @@ -369,7 +398,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -563,7 +592,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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index d1156af5a8bf..5393a2c1d375 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -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; @@ -135,6 +146,7 @@ internal class Variant public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { 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 +167,7 @@ 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(); + 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 +223,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); @@ -254,6 +268,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 +301,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; @@ -366,6 +382,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 +408,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 +440,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 +463,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -507,7 +539,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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsAttributes.cs index f18662815281..5735f61296c8 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -48,6 +48,18 @@ public ProfileAttribute(params string[] profiles) } } + [AttributeUsage(AttributeTargets.Class)] + public class HttpPathAttribute : Attribute + { + public string Path { get; set; } + public string ApiVersion { get; set; } + } + + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -102,6 +114,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsExtensions.cs index baf0ea059cb1..da2beb710de8 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.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/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 93fa05b15f20..8230faa24398 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/Context.cs b/src/VMware/VMware.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..c6517f9d78aa --- /dev/null +++ b/src/VMware/VMware.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.VMware.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.VMware.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.VMware.VMware Client { get; } + } +} diff --git a/src/VMware/VMware.Autorest/generated/runtime/Events.cs b/src/VMware/VMware.Autorest/generated/runtime/Events.cs index 2734f3e4c746..4ced369cce28 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/Events.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/ISendAsync.cs b/src/VMware/VMware.Autorest/generated/runtime/ISendAsync.cs index 3141d9596fc9..cd04fc95ed10 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/ISendAsync.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.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/src/VMware/VMware.Autorest/generated/runtime/InfoAttribute.cs b/src/VMware/VMware.Autorest/generated/runtime/InfoAttribute.cs index 87babfaa15cc..1a8f15b51a9a 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/InfoAttribute.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/InputHandler.cs b/src/VMware/VMware.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..75e2f70c3faa --- /dev/null +++ b/src/VMware/VMware.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.VMware.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.VMware.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/runtime/MessageAttribute.cs b/src/VMware/VMware.Autorest/generated/runtime/MessageAttribute.cs index 9add89778ddc..2a21d3061415 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/MessageAttribute.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/MessageAttribute.cs @@ -21,7 +21,7 @@ public class GenericBreakingChangeAttribute : Attribute //The version the change is effective from, non mandatory public string DeprecateByVersion { get; } - public bool DeprecateByVersionSet { get; } = false; + public string DeprecateByAzVersion { get; } //The date on which the change comes in effect public DateTime ChangeInEfectByDate { get; } @@ -32,23 +32,18 @@ public class GenericBreakingChangeAttribute : Attribute //New way fo calling the cmdlet public string NewWay { get; set; } - public GenericBreakingChangeAttribute(string message) - { - _message = message; - } - - public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion) { _message = message; + this.DeprecateByAzVersion = deprecateByAzVersion; this.DeprecateByVersion = deprecateByVersion; - this.DeprecateByVersionSet = true; } - public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + public GenericBreakingChangeAttribute(string message, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) { _message = message; this.DeprecateByVersion = deprecateByVersion; - this.DeprecateByVersionSet = true; + this.DeprecateByAzVersion = deprecateByAzVersion; if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) { @@ -86,10 +81,8 @@ public void PrintCustomAttributeInfo(Action writeOutput) writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); } - if (DeprecateByVersionSet) - { - writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); - } + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByAzVersion, this.DeprecateByAzVersion)); + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); if (OldWay != null && NewWay != null) { @@ -114,18 +107,13 @@ public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute public string ReplacementCmdletName { get; set; } - public CmdletBreakingChangeAttribute() : - base(string.Empty) + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { } - public CmdletBreakingChangeAttribute(string deprecateByVersione) : - base(string.Empty, deprecateByVersione) - { - } - - public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public CmdletBreakingChangeAttribute(string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { } @@ -146,20 +134,15 @@ protected override string GetAttributeSpecificMessage() public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute { public string[] ChangedParameterSet { set; get; } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : - base(string.Empty) - { - ChangedParameterSet = changedParameterSet; - } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : - base(string.Empty, deprecateByVersione) + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { ChangedParameterSet = changedParameterSet; } - public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { ChangedParameterSet = changedParameterSet; } @@ -185,6 +168,11 @@ public class PreviewMessageAttribute : Attribute { public string _message; + public DateTime EstimatedGaDate { get; } + + public bool IsEstimatedGaDateSet { get; } = false; + + public PreviewMessageAttribute() { this._message = Resources.PreviewCmdletMessage; @@ -192,12 +180,26 @@ public PreviewMessageAttribute() public PreviewMessageAttribute(string message) { - this._message = message; + this._message = string.IsNullOrEmpty(message) ? Resources.PreviewCmdletMessage : message; } - public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + public PreviewMessageAttribute(string message, string estimatedDateOfGa) : this(message) { - psCmdlet.WriteWarning(this._message); + if (DateTime.TryParse(estimatedDateOfGa, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.EstimatedGaDate = result; + this.IsEstimatedGaDateSet = true; + } + } + + public void PrintCustomAttributeInfo(Action writeOutput) + { + writeOutput(this._message); + + if (IsEstimatedGaDateSet) + { + writeOutput(string.Format(Resources.PreviewCmdletETAMessage, this.EstimatedGaDate.ToShortDateString())); + } } public virtual bool IsApplicableToInvocation(InvocationInfo invocation) @@ -219,20 +221,14 @@ public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute public String NewParameterType { get; set; } - public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : - base(string.Empty) + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { this.NameOfParameterChanging = nameOfParameterChanging; } - public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : - base(string.Empty, deprecateByVersion) - { - this.NameOfParameterChanging = nameOfParameterChanging; - } - - public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { this.NameOfParameterChanging = nameOfParameterChanging; } @@ -298,20 +294,14 @@ public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute public string[] NewOutputProperties { get; set; } - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : - base(string.Empty) - { - this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; - } - - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : - base(string.Empty, deprecateByVersion) + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion) { this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; } - public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : - base(string.Empty, deprecateByVersion, changeInEfectByDate) + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByAzVersion, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByAzVersion, deprecateByVersion, changeInEfectByDate) { this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; } diff --git a/src/VMware/VMware.Autorest/generated/runtime/MessageAttributeHelper.cs b/src/VMware/VMware.Autorest/generated/runtime/MessageAttributeHelper.cs index ba2fb4585f36..7642bf8e08a0 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/MessageAttributeHelper.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/MessageAttributeHelper.cs @@ -23,6 +23,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime using System.Threading.Tasks; public class MessageAttributeHelper { + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; @@ -34,7 +35,7 @@ public class MessageAttributeHelper * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, * We only process the Parameter beaking change attributes attached only params listed in this list (if present) * */ - public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet, bool showPreviewMessage = true) { bool supressWarningOrError = false; @@ -52,37 +53,53 @@ public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, Inv //Do not process the attributes at runtime... The env variable to override the warning messages is set return; } + if (IsAzure && invocationInfo.BoundParameters.ContainsKey("DefaultProfile")) + { + psCmdlet.WriteWarning("The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription."); + } + + ProcessBreakingChangeAttributesAtRuntime(commandInfo, invocationInfo, parameterSet, psCmdlet); + + } + private static void ProcessBreakingChangeAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); StringBuilder sb = new StringBuilder(); - Action appendBreakingChangeInfo = (string s) => sb.Append(s); + Action appendAttributeMessage = (string s) => sb.Append(s); if (attributes != null && attributes.Count > 0) { - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); foreach (GenericBreakingChangeAttribute attribute in attributes) { - attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } - appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + appendAttributeMessage(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); psCmdlet.WriteWarning(sb.ToString()); } + } + + public static void ProcessPreviewMessageAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + StringBuilder sb = new StringBuilder(); + Action appendAttributeMessage = (string s) => sb.Append(s); if (previewAttributes != null && previewAttributes.Count > 0) { foreach (PreviewMessageAttribute attribute in previewAttributes) { - attribute.PrintCustomAttributeInfo(psCmdlet); + attribute.PrintCustomAttributeInfo(appendAttributeMessage); } + psCmdlet.WriteWarning(sb.ToString()); } } - /** * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) * And returns all the deprecation attributes attached to it @@ -124,6 +141,12 @@ private static IEnumerable GetAllBreakingChangeA } return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); } + + public static bool ContainsPreviewAttribute(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + return GetAllPreviewAttributesInType(commandInfo, invocationInfo)?.Count() > 0; + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) { List attributeList = new List(); diff --git a/src/VMware/VMware.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/src/VMware/VMware.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 453c85782670..dbf25b7512cb 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.Designer.cs b/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.Designer.cs index 0110d3e3839f..95b9fcdfb7bb 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.Designer.cs +++ b/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.Designer.cs @@ -734,7 +734,7 @@ public static string BreakingChangesAttributesInEffectByDateMessage } /// - /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// Looks up a localized string similar to Note :The change is expected to take effect from version : '{0}' /// ///. /// @@ -746,6 +746,19 @@ public static string BreakingChangesAttributesInEffectByVersion } } + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from az version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByAzVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByAzVersion", resourceCulture); + } + } + /// /// Looks up a localized string similar to ```powershell ///# Old @@ -3122,7 +3135,16 @@ public static string PortalInstructionsGit } /// - /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// Looks up a localized string similar to The estimated generally available date is '{0}'.. + /// + public static string PreviewCmdletETAMessage { + get { + return ResourceManager.GetString("PreviewCmdletETAMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. Its behavior is subject to change based on customer feedback.. /// public static string PreviewCmdletMessage { @@ -5630,4 +5652,4 @@ public static string YesHint } } } -} +} \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.resx b/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.resx index 598cd53e958a..a08a2e50172b 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.resx +++ b/src/VMware/VMware.Autorest/generated/runtime/Properties/Resources.resx @@ -1705,7 +1705,7 @@ Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can -- The change is expected to take effect from the version : '{0}' +- The change is expected to take effect from version : '{0}' ```powershell @@ -1736,6 +1736,12 @@ The type of the parameter is changing from '{0}' to '{1}'. Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. - This cmdlet is in preview. The functionality may not be available in the selected subscription. + This cmdlet is in preview. Its behavior is subject to change based on customer feedback. + + + The estimated generally available date is '{0}'. + + + - The change is expected to take effect from Az version : '{0}' \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/generated/runtime/SerializationMode.cs b/src/VMware/VMware.Autorest/generated/runtime/SerializationMode.cs index 65cf8c3d19ca..16ce1c28bdb4 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/SerializationMode.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/generated/runtime/TypeConverterExtensions.cs b/src/VMware/VMware.Autorest/generated/runtime/TypeConverterExtensions.cs index 173b2509815b..78fa7f28fa59 100644 --- a/src/VMware/VMware.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/src/VMware/VMware.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/src/VMware/VMware.Autorest/help/Az.VMware.md b/src/VMware/VMware.Autorest/help/Az.VMware.md new file mode 100644 index 000000000000..604f28e37ac2 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Az.VMware.md @@ -0,0 +1,151 @@ +--- +Module Name: Az.VMware +Module Guid: 6ced3ed2-fb86-4a72-aca7-369161b12fea +Download Help Link: https://learn.microsoft.com/powershell/module/az.vmware +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.VMware Module +## Description +Microsoft Azure PowerShell: VMware cmdlets + +## Az.VMware Cmdlets +### [Get-AzVMwareAddon](Get-AzVMwareAddon.md) +Get an addon by name in a private cloud + +### [Get-AzVMwareAuthorization](Get-AzVMwareAuthorization.md) +Get an ExpressRoute Circuit Authorization by name in a private cloud + +### [Get-AzVMwareCloudLink](Get-AzVMwareCloudLink.md) +Get an cloud link by name in a private cloud + +### [Get-AzVMwareCluster](Get-AzVMwareCluster.md) +Get a cluster by name in a private cloud + +### [Get-AzVMwareClusterZone](Get-AzVMwareClusterZone.md) +List hosts by zone in a cluster + +### [Get-AzVMwareDatastore](Get-AzVMwareDatastore.md) +Get a datastore in a private cloud cluster + +### [Get-AzVMwareGlobalReachConnection](Get-AzVMwareGlobalReachConnection.md) +Get a global reach connection by name in a private cloud + +### [Get-AzVMwarePlacementPolicy](Get-AzVMwarePlacementPolicy.md) +Get a placement policy by name in a private cloud cluster + +### [Get-AzVMwarePrivateCloud](Get-AzVMwarePrivateCloud.md) +Get a private cloud + +### [Get-AzVMwarePrivateCloudAdminCredential](Get-AzVMwarePrivateCloudAdminCredential.md) +List the admin credentials for the private cloud + +### [Get-AzVMwareVirtualMachine](Get-AzVMwareVirtualMachine.md) +Get a virtual machine by id in a private cloud cluster + +### [New-AzVMwareAddon](New-AzVMwareAddon.md) +Create or update a addon in a private cloud + +### [New-AzVMwareAddonSrmPropertiesObject](New-AzVMwareAddonSrmPropertiesObject.md) +Create a in-memory object for AddonSrmProperties + +### [New-AzVMwareAddonVrPropertiesObject](New-AzVMwareAddonVrPropertiesObject.md) +Create a in-memory object for AddonVrProperties + +### [New-AzVMwareAuthorization](New-AzVMwareAuthorization.md) +Create an ExpressRoute Circuit Authorization in a private cloud + +### [New-AzVMwareCloudLink](New-AzVMwareCloudLink.md) +Create a cloud link in a private cloud + +### [New-AzVMwareCluster](New-AzVMwareCluster.md) +Create a cluster in a private cloud + +### [New-AzVMwareDatastore](New-AzVMwareDatastore.md) +Create a datastore in a private cloud cluster + +### [New-AzVMwareGlobalReachConnection](New-AzVMwareGlobalReachConnection.md) +Create a global reach connection in a private cloud + +### [New-AzVMwareIdentitySourceObject](New-AzVMwareIdentitySourceObject.md) +Create an in-memory object for IdentitySource. + +### [New-AzVMwarePlacementPolicy](New-AzVMwarePlacementPolicy.md) +Create a placement policy in a private cloud cluster + +### [New-AzVMwarePrivateCloud](New-AzVMwarePrivateCloud.md) +Create a private cloud + +### [New-AzVMwarePrivateCloudNsxtPassword](New-AzVMwarePrivateCloudNsxtPassword.md) +Rotate the NSX-T Manager password + +### [New-AzVMwarePrivateCloudVcenterPassword](New-AzVMwarePrivateCloudVcenterPassword.md) +Rotate the vCenter password + +### [New-AzVMwarePSCredentialExecutionParameterObject](New-AzVMwarePSCredentialExecutionParameterObject.md) +Create a in-memory object for PSCredentialExecutionParameter + +### [New-AzVMwareScriptSecureStringExecutionParameterObject](New-AzVMwareScriptSecureStringExecutionParameterObject.md) +Create a in-memory object for ScriptSecureStringExecutionParameter + +### [New-AzVMwareScriptStringExecutionParameterObject](New-AzVMwareScriptStringExecutionParameterObject.md) +Create a in-memory object for ScriptStringExecutionParameter + +### [New-AzVMwareVmHostPlacementPolicyPropertiesObject](New-AzVMwareVmHostPlacementPolicyPropertiesObject.md) +Create an in-memory object for VmHostPlacementPolicyProperties. + +### [New-AzVMwareVMPlacementPolicyPropertiesObject](New-AzVMwareVMPlacementPolicyPropertiesObject.md) +Create an in-memory object for VMPlacementPolicyProperties. + +### [Remove-AzVMwareAddon](Remove-AzVMwareAddon.md) +Delete a addon in a private cloud + +### [Remove-AzVMwareAuthorization](Remove-AzVMwareAuthorization.md) +Delete an ExpressRoute Circuit Authorization in a private cloud + +### [Remove-AzVMwareCloudLink](Remove-AzVMwareCloudLink.md) +Delete a cloud link in a private cloud + +### [Remove-AzVMwareCluster](Remove-AzVMwareCluster.md) +Delete a cluster in a private cloud + +### [Remove-AzVMwareDatastore](Remove-AzVMwareDatastore.md) +Delete a datastore in a private cloud cluster + +### [Remove-AzVMwareGlobalReachConnection](Remove-AzVMwareGlobalReachConnection.md) +Delete a global reach connection in a private cloud + +### [Remove-AzVMwarePlacementPolicy](Remove-AzVMwarePlacementPolicy.md) +Delete a placement policy in a private cloud cluster + +### [Remove-AzVMwarePrivateCloud](Remove-AzVMwarePrivateCloud.md) +Delete a private cloud + +### [Test-AzVMwareLocationQuotaAvailability](Test-AzVMwareLocationQuotaAvailability.md) +Return quota for subscription by region + +### [Test-AzVMwareLocationTrialAvailability](Test-AzVMwareLocationTrialAvailability.md) +Return trial status for subscription by region + +### [Update-AzVMwareAuthorization](Update-AzVMwareAuthorization.md) +Create an ExpressRoute Circuit Authorization in a private cloud + +### [Update-AzVMwareCloudLink](Update-AzVMwareCloudLink.md) +Create a cloud link in a private cloud + +### [Update-AzVMwareCluster](Update-AzVMwareCluster.md) +Update a cluster in a private cloud + +### [Update-AzVMwareDatastore](Update-AzVMwareDatastore.md) +Create a datastore in a private cloud cluster + +### [Update-AzVMwareGlobalReachConnection](Update-AzVMwareGlobalReachConnection.md) +Create a global reach connection in a private cloud + +### [Update-AzVMwarePlacementPolicy](Update-AzVMwarePlacementPolicy.md) +Update a placement policy in a private cloud cluster + +### [Update-AzVMwarePrivateCloud](Update-AzVMwarePrivateCloud.md) +Update a private cloud + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareAddon.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareAddon.md new file mode 100644 index 000000000000..26b46b071b89 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareAddon.md @@ -0,0 +1,172 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon +schema: 2.0.0 +--- + +# Get-AzVMwareAddon + +## SYNOPSIS +Get an addon by name in a private cloud + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareAddon -PrivateCloudName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareAddon -AddonType -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareAddon -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get an addon by name in a private cloud + +## EXAMPLES + +### Example 1: List addon under resource group +```powershell +Get-AzVMwareAddon -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +srm Microsoft.AVS/privateClouds/addons azps_test_group +vr Microsoft.AVS/privateClouds/addons azps_test_group +``` + +List addon under resource group + +### Example 2: Get an addon by name in a private cloud +```powershell +Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +vr Microsoft.AVS/privateClouds/addons azps_test_group +``` + +Get an addon by name in a private cloud + +## PARAMETERS + +### -AddonType +Name of the addon for the private cloud + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: AddonName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareAuthorization.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareAuthorization.md new file mode 100644 index 000000000000..7989e26583d2 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareAuthorization.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareauthorization +schema: 2.0.0 +--- + +# Get-AzVMwareAuthorization + +## SYNOPSIS +Get an ExpressRoute Circuit Authorization by name in a private cloud + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareAuthorization -PrivateCloudName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareAuthorization -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get an ExpressRoute Circuit Authorization by name in a private cloud + +## EXAMPLES + +### Example 1: List authorization under resource group +```powershell +Get-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_authorization Microsoft.AVS/privateClouds/authorizations azps_test_group +``` + +List authorization under resource group + +### Example 2: Get authorization by name in a private cloud +```powershell +Get-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_authorization +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_authorization Microsoft.AVS/privateClouds/authorizations azps_test_group +``` + +Get authorization by name in a private cloud + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the ExpressRoute Circuit Authorization in the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud +Aliases: AuthorizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareCloudLink.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareCloudLink.md new file mode 100644 index 000000000000..ae9fcbc49bcc --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareCloudLink.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecloudlink +schema: 2.0.0 +--- + +# Get-AzVMwareCloudLink + +## SYNOPSIS +Get an cloud link by name in a private cloud + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareCloudLink -PrivateCloudName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareCloudLink -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareCloudLink -Name -PrivateCloudInputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get an cloud link by name in a private cloud + +## EXAMPLES + +### Example 1: List cloud link under resource group +```powershell +Get-AzVMwareCloudLink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cloudlink Microsoft.AVS/privateClouds/cloudLinks azps_test_group +``` + +List cloud link under resource group + +### Example 2: Get cloud link by name in a private cloud +```powershell +Get-AzVMwareCloudLink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_cloudlink +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cloudlink Microsoft.AVS/privateClouds/cloudLinks azps_test_group +``` + +Get cloud link by name in a private cloud + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the cloud link resource + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud +Aliases: CloudLinkName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareCluster.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareCluster.md new file mode 100644 index 000000000000..98857bc9ebcf --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareCluster.md @@ -0,0 +1,194 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecluster +schema: 2.0.0 +--- + +# Get-AzVMwareCluster + +## SYNOPSIS +Get a cluster by name in a private cloud + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareCluster -PrivateCloudName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareCluster -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareCluster -Name -PrivateCloudInputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get a cluster by name in a private cloud + +## EXAMPLES + +### Example 1: List clusters under resource group +```powershell +Get-AzVMwareCluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cluster Microsoft.AVS/privateClouds/clusters azps_test_group +``` + +List clusters under resource group + +### Example 2: Get cluster by name in a private cloud +```powershell +Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cluster Microsoft.AVS/privateClouds/clusters azps_test_group +``` + +Get cluster by name in a private cloud + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud +Aliases: ClusterName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareClusterZone.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareClusterZone.md new file mode 100644 index 000000000000..27554bbbe935 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareClusterZone.md @@ -0,0 +1,160 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareclusterzone +schema: 2.0.0 +--- + +# Get-AzVMwareClusterZone + +## SYNOPSIS +List hosts by zone in a cluster + +## SYNTAX + +``` +Get-AzVMwareClusterZone -ClusterName -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +List hosts by zone in a cluster + +## EXAMPLES + +### Example 1: List hosts by zone in a cluster +```powershell +Get-AzVMwareClusterZone -PrivateCloudName SDDC2 -ResourceGroupName TestSddc-rg -ClusterName Cluster-1 +``` + +```output +Host Zone +---- ---- +{esx09-r09.p01.canadacentral.avs.azure.com, esx02-r06.p01.canadacentral.avs.azure.com, esx20-r08.p01.canadacentral.avs.azure.com} 3 +``` + +List hosts by zone in a cluster + +## PARAMETERS + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareDatastore.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareDatastore.md new file mode 100644 index 000000000000..9bd9a091958a --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareDatastore.md @@ -0,0 +1,232 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwaredatastore +schema: 2.0.0 +--- + +# Get-AzVMwareDatastore + +## SYNOPSIS +Get a datastore in a private cloud cluster + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareDatastore -ClusterName -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareDatastore -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareDatastore -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentityCluster +``` +Get-AzVMwareDatastore -ClusterInputObject -Name [-DefaultProfile ] + [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a datastore in a private cloud cluster + +## EXAMPLES + +### Example 1: List datastores in a private cloud cluster. +```powershell +Get-AzVMwareDatastore -ClusterName azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Status ProvisioningState ResourceGroupName +---- ------ ----------------- ----------------- +azps_test_datastore Accessible Succeeded azps_test_group +azps_test_datastore1 Accessible Succeeded azps_test_group +``` + +List datastores in a private cloud cluster. + +### Example 2: Get a datastore in a data store name. +```powershell +Get-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Status ProvisioningState ResourceGroupName +---- ------ ----------------- ----------------- +azps_test_datastore Accessible Succeeded azps_test_group +``` + +Get a datastore in a data store name. + +## PARAMETERS + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the datastore in the private cloud cluster + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityCluster, GetViaIdentityPrivateCloud +Aliases: DatastoreName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareGlobalReachConnection.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareGlobalReachConnection.md new file mode 100644 index 000000000000..667a0fb33a8b --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareGlobalReachConnection.md @@ -0,0 +1,195 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareglobalreachconnection +schema: 2.0.0 +--- + +# Get-AzVMwareGlobalReachConnection + +## SYNOPSIS +Get a global reach connection by name in a private cloud + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareGlobalReachConnection -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareGlobalReachConnection -InputObject [-DefaultProfile ] + [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a global reach connection by name in a private cloud + +## EXAMPLES + +### Example 1: List global reach connection in a private cloud +```powershell +Get-AzVMwareGlobalReachConnection -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_grc Microsoft.AVS/privateClouds/globalReachConnections azps_test_group +``` + +List global reach connection in a private cloud + +### Example 2: Get a global reach connection by name in a private cloud +```powershell +Get-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_grc Microsoft.AVS/privateClouds/globalReachConnections azps_test_group +``` + +Get a global reach connection by name in a private cloud + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the global reach connection in the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud +Aliases: GlobalReachConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwarePlacementPolicy.md b/src/VMware/VMware.Autorest/help/Get-AzVMwarePlacementPolicy.md new file mode 100644 index 000000000000..75facf457710 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwarePlacementPolicy.md @@ -0,0 +1,232 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareplacementpolicy +schema: 2.0.0 +--- + +# Get-AzVMwarePlacementPolicy + +## SYNOPSIS +Get a placement policy by name in a private cloud cluster + +## SYNTAX + +### List (Default) +``` +Get-AzVMwarePlacementPolicy -ClusterName -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwarePlacementPolicy -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentityCluster +``` +Get-AzVMwarePlacementPolicy -ClusterInputObject -Name [-DefaultProfile ] + [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a placement policy by name in a private cloud cluster + +## EXAMPLES + +### Example 1: List placement policy by private cloud cluster +```powershell +Get-AzVMwarePlacementPolicy -ClusterName cluster1 -PrivateCloudName cloud1 -ResourceGroupName group1 +``` + +```output +Name ResourceGroupName +---- ----------------- +policy1 group1 +policy2 group1 +``` + +List placement policy by private cloud cluster + +### Example 2: Get a placement policy by name in a private cloud cluster +```powershell +Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 +``` + +```output +Name ResourceGroupName +---- ----------------- +policy1 group1 +``` + +Get a placement policy by name in a private cloud cluster + +## PARAMETERS + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityCluster, GetViaIdentityPrivateCloud +Aliases: PlacementPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwarePrivateCloud.md b/src/VMware/VMware.Autorest/help/Get-AzVMwarePrivateCloud.md new file mode 100644 index 000000000000..5726f1f60c53 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwarePrivateCloud.md @@ -0,0 +1,175 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloud +schema: 2.0.0 +--- + +# Get-AzVMwarePrivateCloud + +## SYNOPSIS +Get a private cloud + +## SYNTAX + +### List1 (Default) +``` +Get-AzVMwarePrivateCloud [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwarePrivateCloud -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwarePrivateCloud -InputObject [-DefaultProfile ] [] +``` + +### List +``` +Get-AzVMwarePrivateCloud -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get a private cloud + +## EXAMPLES + +### Example 1: List private cloud under subscription +```powershell +Get-AzVMwarePrivateCloud +``` + +```output +Location Name Type +-------- ---- ---- +australiaeast azps_test_cloud Microsoft.AVS/privateClouds +``` + +List private cloud under subscription + +### Example 2: List private cloud under resource group +```powershell +Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group +``` + +```output +Location Name Type ResourceGroupName +-------- ---- ---- ----------------- +australiaeast azps_test_cloud Microsoft.AVS/privateClouds azps_test_group +``` + +List private cloud under resource group + +### Example 3: Get a private cloud by name +```powershell +Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud +``` + +```output +Location Name Type ResourceGroupName +-------- ---- ---- ----------------- +australiaeast azps_test_cloud Microsoft.AVS/privateClouds azps_test_group +``` + +Get a private cloud by name + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PrivateCloudName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List, List1 +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwarePrivateCloudAdminCredential.md b/src/VMware/VMware.Autorest/help/Get-AzVMwarePrivateCloudAdminCredential.md new file mode 100644 index 000000000000..f34230bb077f --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwarePrivateCloudAdminCredential.md @@ -0,0 +1,145 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloudadmincredential +schema: 2.0.0 +--- + +# Get-AzVMwarePrivateCloudAdminCredential + +## SYNOPSIS +List the admin credentials for the private cloud + +## SYNTAX + +``` +Get-AzVMwarePrivateCloudAdminCredential -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +List the admin credentials for the private cloud + +## EXAMPLES + +### Example 1: Get the admin credentials for the private cloud +```powershell +Get-AzVMwarePrivateCloudAdminCredential -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +NsxtUsername VcenterUsername +------------ --------------- +admin cloudadmin@vsphere.local +``` + +Get the admin credentials for the private cloud + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAdminCredentials + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Get-AzVMwareVirtualMachine.md b/src/VMware/VMware.Autorest/help/Get-AzVMwareVirtualMachine.md new file mode 100644 index 000000000000..e96a93ab4898 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Get-AzVMwareVirtualMachine.md @@ -0,0 +1,232 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarevirtualmachine +schema: 2.0.0 +--- + +# Get-AzVMwareVirtualMachine + +## SYNOPSIS +Get a virtual machine by id in a private cloud cluster + +## SYNTAX + +### List (Default) +``` +Get-AzVMwareVirtualMachine -ClusterName -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzVMwareVirtualMachine -ClusterName -Id -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzVMwareVirtualMachine -InputObject [-DefaultProfile ] [] +``` + +### GetViaIdentityCluster +``` +Get-AzVMwareVirtualMachine -ClusterInputObject -Id [-DefaultProfile ] + [] +``` + +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareVirtualMachine -ClusterName -Id -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get a virtual machine by id in a private cloud cluster + +## EXAMPLES + +### Example 1: List virtual machine in a private cloud cluster +```powershell +Get-AzVMwareVirtualMachine -ClusterName cluster1 -PrivateCloudName cloud1 -ResourceGroupName group1 +``` + +```output +Name ResourceGroupName +---- ----------------- +vm-209 group1 +vm-128 group1 +``` + +List virtual machine in a private cloud cluster + +### Example 2: Get a virtual machine by id in a private cloud cluster +```powershell +Get-AzVMwareVirtualMachine -Id vm-209 -ClusterName cluster1 -PrivateCloudName cloud1 -ResourceGroupName group1 +``` + +```output +Name ResourceGroupName +---- ----------------- +vm-209 group1 +``` + +Get a virtual machine by id in a private cloud cluster + +## PARAMETERS + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityPrivateCloud, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +Virtual Machine identifier + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentityCluster, GetViaIdentityPrivateCloud +Aliases: VirtualMachineId + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVirtualMachine + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareAddon.md b/src/VMware/VMware.Autorest/help/New-AzVMwareAddon.md new file mode 100644 index 000000000000..c1247e910bd5 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareAddon.md @@ -0,0 +1,192 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon +schema: 2.0.0 +--- + +# New-AzVMwareAddon + +## SYNOPSIS +Create or update a addon in a private cloud + +## SYNTAX + +``` +New-AzVMwareAddon -PrivateCloudName -ResourceGroupName [-SubscriptionId ] + [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create or update a addon in a private cloud + +## EXAMPLES + +### Example 1: Create an addon in a private cloud +```powershell +$data = New-AzVMwareAddonVrPropertiesObject -VrsCount 2 +New-AzVMwareAddon -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Property $data +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +vr Microsoft.AVS/privateClouds/addons azps_test_group +``` + +Create an addon in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Property +The properties of an addon resource +To construct, see NOTES section for PROPERTY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareAddonSrmPropertiesObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareAddonSrmPropertiesObject.md new file mode 100644 index 000000000000..e248caef4409 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareAddonSrmPropertiesObject.md @@ -0,0 +1,66 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject +schema: 2.0.0 +--- + +# New-AzVMwareAddonSrmPropertiesObject + +## SYNOPSIS +Create a in-memory object for AddonSrmProperties + +## SYNTAX + +``` +New-AzVMwareAddonSrmPropertiesObject -LicenseKey [] +``` + +## DESCRIPTION +Create a in-memory object for AddonSrmProperties + +## EXAMPLES + +### Example 1: Create a local SRM object for the Addon Property parameter +```powershell +New-AzVMwareAddonSrmPropertiesObject -LicenseKey "YourLicenseKeyValue" +``` + +```output +AddonType LicenseKey ProvisioningState +--------- ---------- ----------------- +SRM YourLicenseKeyValue +``` + +Create a local SRM object for the Addon Property parameter + +## PARAMETERS + +### -LicenseKey +The Site Recovery Manager (SRM) license. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonSrmProperties + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareAddonVrPropertiesObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareAddonVrPropertiesObject.md new file mode 100644 index 000000000000..34d8978cd7c8 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareAddonVrPropertiesObject.md @@ -0,0 +1,66 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject +schema: 2.0.0 +--- + +# New-AzVMwareAddonVrPropertiesObject + +## SYNOPSIS +Create a in-memory object for AddonVrProperties + +## SYNTAX + +``` +New-AzVMwareAddonVrPropertiesObject -VrsCount [] +``` + +## DESCRIPTION +Create a in-memory object for AddonVrProperties + +## EXAMPLES + +### Example 1: Create a local VR object for the Addon Property parameter +```powershell +New-AzVMwareAddonVrPropertiesObject -VrsCount 2 +``` + +```output +AddonType ProvisioningState VrsCount +--------- ----------------- -------- +VR 2 +``` + +Create a local VR object for the Addon Property parameter + +## PARAMETERS + +### -VrsCount +The vSphere Replication Server (VRS) count. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.AddonVrProperties + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareAuthorization.md b/src/VMware/VMware.Autorest/help/New-AzVMwareAuthorization.md new file mode 100644 index 000000000000..df7bacad89f7 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareAuthorization.md @@ -0,0 +1,238 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareauthorization +schema: 2.0.0 +--- + +# New-AzVMwareAuthorization + +## SYNOPSIS +Create an ExpressRoute Circuit Authorization in a private cloud + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareAuthorization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create an ExpressRoute Circuit Authorization in a private cloud + +## EXAMPLES + +### Example 1: Create an Circuit Authorization in a private cloud +```powershell +New-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_authorization Microsoft.AVS/privateClouds/authorizations azps_test_group +``` + +Create an Circuit Authorization in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the ExpressRoute Circuit Authorization in the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: AuthorizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareCloudLink.md b/src/VMware/VMware.Autorest/help/New-AzVMwareCloudLink.md new file mode 100644 index 000000000000..2d7894b3351c --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareCloudLink.md @@ -0,0 +1,253 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecloudlink +schema: 2.0.0 +--- + +# New-AzVMwareCloudLink + +## SYNOPSIS +Create a cloud link in a private cloud + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-LinkedCloud ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareCloudLink -InputObject [-LinkedCloud ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareCloudLink -Name -PrivateCloudInputObject [-LinkedCloud ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a cloud link in a private cloud + +## EXAMPLES + +### Example 1: Create a cloud link in a private cloud +```powershell +New-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cloudlink Microsoft.AVS/privateClouds/cloudLinks azps_test_group +``` + +Create a cloud link in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkedCloud +Identifier of the other private cloud participating in the link. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the cloud link resource + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: CloudLinkName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareCluster.md b/src/VMware/VMware.Autorest/help/New-AzVMwareCluster.md new file mode 100644 index 000000000000..27fbb329bf40 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareCluster.md @@ -0,0 +1,285 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecluster +schema: 2.0.0 +--- + +# New-AzVMwareCluster + +## SYNOPSIS +Create a cluster in a private cloud + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName -SkuName + [-SubscriptionId ] [-ClusterSize ] [-PropertiesHost ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareCluster -InputObject -SkuName [-ClusterSize ] + [-PropertiesHost ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareCluster -Name -PrivateCloudInputObject -SkuName + [-ClusterSize ] [-PropertiesHost ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a cluster in a private cloud + +## EXAMPLES + +### Example 1: Create a cluster +```powershell +New-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -ClusterSize 3 -SkuName av36 +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cluster Microsoft.AVS/privateClouds/clusters azps_test_group +``` + +Create a cluster + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterSize +The cluster size + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: ClusterName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesHost +The hosts + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The name of the SKU. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareDatastore.md b/src/VMware/VMware.Autorest/help/New-AzVMwareDatastore.md new file mode 100644 index 000000000000..9633165e9fcb --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareDatastore.md @@ -0,0 +1,340 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwaredatastore +schema: 2.0.0 +--- + +# New-AzVMwareDatastore + +## SYNOPSIS +Create a datastore in a private cloud cluster + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzVMwareDatastore -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityClusterExpanded +``` +New-AzVMwareDatastore -ClusterInputObject -Name [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareDatastore -InputObject [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DiskPoolVolumeLunName ] [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] + [-NetAppVolumeId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create a datastore in a private cloud cluster + +## EXAMPLES + +### Example 1: Create or update a datastore in a private cloud cluster. +```powershell +New-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" +``` + +```output +Name Status ProvisioningState ResourceGroupName +---- ------ ----------------- ----------------- +azps_test_datastore Accessible Succeeded azps_test_group +``` + +Create or update a datastore in a private cloud cluster. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeLunName +Name of the LUN to be used for datastore + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeMountOption +Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeTargetId +Azure resource ID of the iSCSI target + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the datastore in the private cloud cluster + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityClusterExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: DatastoreName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetAppVolumeId +Azure resource ID of the NetApp volume + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareGlobalReachConnection.md b/src/VMware/VMware.Autorest/help/New-AzVMwareGlobalReachConnection.md new file mode 100644 index 000000000000..9ec7d0920458 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareGlobalReachConnection.md @@ -0,0 +1,286 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareglobalreachconnection +schema: 2.0.0 +--- + +# New-AzVMwareGlobalReachConnection + +## SYNOPSIS +Create a global reach connection in a private cloud + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-AuthorizationKey ] [-ExpressRouteId ] + [-PeerExpressRouteResourceId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareGlobalReachConnection -InputObject [-AuthorizationKey ] + [-ExpressRouteId ] [-PeerExpressRouteResourceId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-AuthorizationKey ] [-ExpressRouteId ] [-PeerExpressRouteResourceId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a global reach connection in a private cloud + +## EXAMPLES + +### Example 1: Create a global reach connection in a private cloud +```powershell +New-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -AuthorizationKey "df530ffb-5a57-4437-a3eb-08e4c73ce011" -PeerExpressRouteResourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/tnt16-cust-mp01-mock01/providers/Microsoft.Network/expressRouteCircuits/tnt16-cust-mp01-mock01-er" +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_grc Microsoft.AVS/privateClouds/globalReachConnections azps_test_group +``` + +Create a global reach connection in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthorizationKey +Authorization key from the peer express route used for the global reach connection + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpressRouteId +The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the global reach connection in the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: GlobalReachConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PeerExpressRouteResourceId +Identifier of the ExpressRoute Circuit to peer with in the global reach connection + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareIdentitySourceObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareIdentitySourceObject.md new file mode 100644 index 000000000000..5e817b98b640 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareIdentitySourceObject.md @@ -0,0 +1,210 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject +schema: 2.0.0 +--- + +# New-AzVMwareIdentitySourceObject + +## SYNOPSIS +Create an in-memory object for IdentitySource. + +## SYNTAX + +``` +New-AzVMwareIdentitySourceObject [-Alias ] [-BaseGroupDn ] [-BaseUserDn ] + [-Domain ] [-Name ] [-Password ] [-PrimaryServer ] + [-SecondaryServer ] [-Ssl ] [-Username ] [] +``` + +## DESCRIPTION +Create an in-memory object for IdentitySource. + +## EXAMPLES + +### Example 1: Create an in-memory object for IdentitySource +```powershell +New-AzVMwareIdentitySourceObject -Alias test +``` + +```output +Alias : test +BaseGroupDn : +BaseUserDn : +Domain : +Name : +Password : +PrimaryServer : +SecondaryServer : +Ssl : +Username : +``` + +Create an in-memory object for IdentitySource + +## PARAMETERS + +### -Alias +The domain's NetBIOS name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BaseGroupDn +The base distinguished name for groups. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BaseUserDn +The base distinguished name for users. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Domain +The domain's dns name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the identity source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Password +The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrimaryServer +Primary server URL. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecondaryServer +Secondary server URL. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Ssl +Protect LDAP communication using SSL certificate (LDAPS). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwarePSCredentialExecutionParameterObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwarePSCredentialExecutionParameterObject.md new file mode 100644 index 000000000000..cf04b455cd2a --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwarePSCredentialExecutionParameterObject.md @@ -0,0 +1,97 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject +schema: 2.0.0 +--- + +# New-AzVMwarePSCredentialExecutionParameterObject + +## SYNOPSIS +Create a in-memory object for PSCredentialExecutionParameter + +## SYNTAX + +``` +New-AzVMwarePSCredentialExecutionParameterObject -Name [-Password ] [-Username ] + [] +``` + +## DESCRIPTION +Create a in-memory object for PSCredentialExecutionParameter + +## EXAMPLES + +### Example 1: Create a local PS Credential Execution object +```powershell +New-AzVMwarePSCredentialExecutionParameterObject -Name azps_test_credentialvalue -Password "passwordValue" -Username "usernameValue" +``` + +```output +Name Password Type Username +---- -------- ---- -------- +azps_test_credentialvalue passwordValue Credential usernameValue +``` + +Create a local PS Credential Execution object + +## PARAMETERS + +### -Name +The parameter name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Password +password for login. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +username for login. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.PsCredentialExecutionParameter + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwarePlacementPolicy.md b/src/VMware/VMware.Autorest/help/New-AzVMwarePlacementPolicy.md new file mode 100644 index 000000000000..8aebc309fd35 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwarePlacementPolicy.md @@ -0,0 +1,308 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareplacementpolicy +schema: 2.0.0 +--- + +# New-AzVMwarePlacementPolicy + +## SYNOPSIS +Create a placement policy in a private cloud cluster + +## SYNTAX + +### CreateExpanded (Default) +``` +New-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-Property ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityClusterExpanded +``` +New-AzVMwarePlacementPolicy -ClusterInputObject -Name + [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwarePlacementPolicy -InputObject [-Property ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create a placement policy in a private cloud cluster + +## EXAMPLES + +### Example 1: Create or update a placement policy in a private cloud cluster +```powershell +$abc = New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} +New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -Property $abc +``` + +```output +Name ResourceGroupName +---- ----------------- +policy1 group1 +``` + +Create or update a placement policy in a private cloud cluster + +### Example 2: Create or update a placement policy in a private cloud cluster +```powershell +$abc = New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} +New-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -Property $abc +``` + +```output +Name ResourceGroupName +---- ----------------- +policy1 group1 +``` + +Create or update a placement policy in a private cloud cluster + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + +```yaml +Type: System.String +Parameter Sets: CreateExpanded, CreateViaIdentityClusterExpanded, CreateViaIdentityPrivateCloudExpanded +Aliases: PlacementPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Property +placement policy properties +To construct, see NOTES section for PROPERTY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: CreateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloud.md b/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloud.md new file mode 100644 index 000000000000..7a6769da558a --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloud.md @@ -0,0 +1,489 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud +schema: 2.0.0 +--- + +# New-AzVMwarePrivateCloud + +## SYNOPSIS +Create a private cloud + +## SYNTAX + +``` +New-AzVMwarePrivateCloud -Name -ResourceGroupName -Location + -ManagementClusterSize -NetworkBlock -Sku [-SubscriptionId ] [-AcceptEULA] + [-AvailabilitySecondaryZone ] [-AvailabilityStrategy ] [-AvailabilityZone ] + [-EncryptionStatus ] [-ExtendedNetworkBlock ] [-IdentitySource ] + [-IdentityType ] [-Internet ] [-KeyVaultPropertyKeyName ] + [-KeyVaultPropertyKeyVaultUrl ] [-KeyVaultPropertyKeyVersion ] + [-ManagementClusterHost ] [-NsxtPassword ] [-Tag ] [-VcenterPassword ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a private cloud + +## EXAMPLES + +### Example 1: Create a private cloud +```powershell +New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast +``` + +```output +Location Name Type ResourceGroupName +-------- ---- ---- ----------------- +australiaeast azps_test_cloud Microsoft.AVS/privateClouds azps_test_group +``` + +Create a private cloud + +## PARAMETERS + +### -AcceptEULA +Accept EULA of AVS, legal term will pop up without this parameter provided + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AvailabilitySecondaryZone +The secondary availability zone for the private cloud + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AvailabilityStrategy +The availability strategy for the private cloud + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AvailabilityZone +The primary availability zone for the private cloud + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionStatus +Status of customer managed encryption key + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedNetworkBlock +Array of additional networks noncontiguous with networkBlock. +Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. +Make sure the CIDR format conforms to (A.B.C.D/X). + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentitySource +vCenter Single Sign On Identity Sources +To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +The type of identity used for the private cloud. +The type 'SystemAssigned' refers to an implicitly created identity. +The type 'None' will remove any identities from the Private Cloud. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Internet +Connectivity to internet is enabled or disabled + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyName +The name of the key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyVaultUrl +The URL of the vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyVersion +The version of the key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Resource location + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagementClusterHost +The hosts + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagementClusterSize +The cluster size + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: PrivateCloudName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkBlock +The block of addresses should be unique across VNet in your subscription as well as on-premise. +Make sure the CIDR format is conformed to (A.B.C.D/X) where A,B,C,D are between 0 and 255, and X is between 0 and 22 + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NsxtPassword +Optionally, set the NSX-T Manager password when the private cloud is created + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sku +The name of the SKU. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VcenterPassword +Optionally, set the vCenter admin password when the private cloud is created + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloudNsxtPassword.md b/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloudNsxtPassword.md new file mode 100644 index 000000000000..4c399e6c6bc9 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloudNsxtPassword.md @@ -0,0 +1,214 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudnsxtpassword +schema: 2.0.0 +--- + +# New-AzVMwarePrivateCloudNsxtPassword + +## SYNOPSIS +Rotate the NSX-T Manager password + +## SYNTAX + +### Rotate (Default) +``` +New-AzVMwarePrivateCloudNsxtPassword -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### RotateViaIdentity +``` +New-AzVMwarePrivateCloudNsxtPassword -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Rotate the NSX-T Manager password + +## EXAMPLES + +### Example 1: Rotate the NSX-T Manager password +```powershell +New-AzVMwarePrivateCloudNsxtPassword -ResourceGroupName azps_test_group -PrivateCloudName azps_test_cloud -PassThru +``` + +```output +True +``` + +Rotate the NSX-T Manager password + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: RotateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloudVcenterPassword.md b/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloudVcenterPassword.md new file mode 100644 index 000000000000..e1708c525114 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwarePrivateCloudVcenterPassword.md @@ -0,0 +1,214 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudvcenterpassword +schema: 2.0.0 +--- + +# New-AzVMwarePrivateCloudVcenterPassword + +## SYNOPSIS +Rotate the vCenter password + +## SYNTAX + +### Rotate (Default) +``` +New-AzVMwarePrivateCloudVcenterPassword -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### RotateViaIdentity +``` +New-AzVMwarePrivateCloudVcenterPassword -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Rotate the vCenter password + +## EXAMPLES + +### Example 1: Rotate the vCenter password +```powershell +New-AzVMwarePrivateCloudVcenterPassword -ResourceGroupName azps_test_group -PrivateCloudName azps_test_cloud -PassThru +``` + +```output +True +``` + +Rotate the vCenter password + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: RotateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Rotate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md new file mode 100644 index 000000000000..34dec74b2f80 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md @@ -0,0 +1,82 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptSecureStringExecutionParameterObject +schema: 2.0.0 +--- + +# New-AzVMwareScriptSecureStringExecutionParameterObject + +## SYNOPSIS +Create a in-memory object for ScriptSecureStringExecutionParameter + +## SYNTAX + +``` +New-AzVMwareScriptSecureStringExecutionParameterObject -Name [-SecureValue ] + [] +``` + +## DESCRIPTION +Create a in-memory object for ScriptSecureStringExecutionParameter + +## EXAMPLES + +### Example 1: Create a local Script Secure String Execution object +```powershell +New-AzVMwareScriptSecureStringExecutionParameterObject -Name azps_test_securevalue -SecureValue "passwordValue" +``` + +```output +Name SecureValue Type +---- ----------- ---- +azps_test_securevalue passwordValue SecureValue +``` + +Create a local Script Secure String Execution object + +## PARAMETERS + +### -Name +The parameter name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecureValue +A secure value for the passed parameter, not to be stored in logs. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptSecureStringExecutionParameter + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareScriptStringExecutionParameterObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareScriptStringExecutionParameterObject.md new file mode 100644 index 000000000000..69a742473130 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareScriptStringExecutionParameterObject.md @@ -0,0 +1,81 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptStringExecutionParameterObject +schema: 2.0.0 +--- + +# New-AzVMwareScriptStringExecutionParameterObject + +## SYNOPSIS +Create a in-memory object for ScriptStringExecutionParameter + +## SYNTAX + +``` +New-AzVMwareScriptStringExecutionParameterObject -Name [-Value ] [] +``` + +## DESCRIPTION +Create a in-memory object for ScriptStringExecutionParameter + +## EXAMPLES + +### Example 1: Create a local Script String Execution object +```powershell +New-AzVMwareScriptStringExecutionParameterObject -Name azps_test_value -Value "passwordValue" +``` + +```output +Name Value +---- ----------- +azps_test_value passwordValue +``` + +Create a local Script String Execution object + +## PARAMETERS + +### -Name +The parameter name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Value +The value for the passed parameter. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ScriptStringExecutionParameter + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md new file mode 100644 index 000000000000..621dd82066cf --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md @@ -0,0 +1,130 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVMPlacementPolicyPropertiesObject +schema: 2.0.0 +--- + +# New-AzVMwareVMPlacementPolicyPropertiesObject + +## SYNOPSIS +Create an in-memory object for VMPlacementPolicyProperties. + +## SYNTAX + +``` +New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType -Type -VMMember + [-DisplayName ] [-State ] [] +``` + +## DESCRIPTION +Create an in-memory object for VMPlacementPolicyProperties. + +## EXAMPLES + +### Example 1: Create an in-memory object for VMPlacementPolicyProperties. +```powershell + New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType 'Affinity' -Type 'VmVm' -VMMember @{"test"="test"} +``` + +```output +AffinityType : Affinity +DisplayName : +ProvisioningState : +State : +Type : VmVm +VMMember : {System.Collections.Hashtable} +``` + +Create an in-memory object for VMPlacementPolicyProperties. + +## PARAMETERS + +### -AffinityType +placement policy affinity type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisplayName +Display name of the placement policy. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -State +Whether the placement policy is enabled or disabled. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +placement policy type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMMember +Virtual machine members list. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMPlacementPolicyProperties + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md b/src/VMware/VMware.Autorest/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md new file mode 100644 index 000000000000..f513782ca553 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md @@ -0,0 +1,148 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVmHostPlacementPolicyPropertiesObject +schema: 2.0.0 +--- + +# New-AzVMwareVmHostPlacementPolicyPropertiesObject + +## SYNOPSIS +Create an in-memory object for VmHostPlacementPolicyProperties. + +## SYNTAX + +``` +New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType -HostMember -Type + -VMMember [-DisplayName ] [-State ] [] +``` + +## DESCRIPTION +Create an in-memory object for VmHostPlacementPolicyProperties. + +## EXAMPLES + +### Example 1: Create an in-memory object for VmHostPlacementPolicyProperties. +```powershell +New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType 'AntiAffinity' -HostMember @{"test"="test"} -Type 'VmHost' -VMMember @{"test"="test"} +``` + +```output +AffinityStrength : +AffinityType : AntiAffinity +AzureHybridBenefitType : +DisplayName : +HostMember : {System.Collections.Hashtable} +ProvisioningState : +State : +Type : VmHost +VMMember : {System.Collections.Hashtable} +``` + +Create an in-memory object for VmHostPlacementPolicyProperties. + +## PARAMETERS + +### -AffinityType +placement policy affinity type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DisplayName +Display name of the placement policy. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HostMember +Host members list. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -State +Whether the placement policy is enabled or disabled. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +placement policy type. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMMember +Virtual machine members list. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.VMHostPlacementPolicyProperties + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/README.md b/src/VMware/VMware.Autorest/help/README.md new file mode 100644 index 000000000000..cfbd6eb15d10 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.VMware` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `..\examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.VMware` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `..\exports` folder. Additionally, when writing custom cmdlets in the `..\custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `..\examples` folder. \ No newline at end of file diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwareAddon.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwareAddon.md new file mode 100644 index 000000000000..8295f3482b66 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwareAddon.md @@ -0,0 +1,233 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareaddon +schema: 2.0.0 +--- + +# Remove-AzVMwareAddon + +## SYNOPSIS +Delete a addon in a private cloud + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwareAddon -AddonType -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwareAddon -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a addon in a private cloud + +## EXAMPLES + +### Example 1: Delete an addon in a private cloud +```powershell +Remove-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +``` + +Delete an addon in a private cloud + +### Example 2: Delete an addon in a private cloud +```powershell +Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareAddon + +``` + +Delete an addon in a private cloud + +## PARAMETERS + +### -AddonType +Name of the addon for the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: AddonName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwareAuthorization.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwareAuthorization.md new file mode 100644 index 000000000000..25b07ddc9bc1 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwareAuthorization.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareauthorization +schema: 2.0.0 +--- + +# Remove-AzVMwareAuthorization + +## SYNOPSIS +Delete an ExpressRoute Circuit Authorization in a private cloud + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwareAuthorization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete an ExpressRoute Circuit Authorization in a private cloud + +## EXAMPLES + +### Example 1: Delete authorization in private cloud +```powershell +Remove-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_authorization + +``` + +Delete authorization in private cloud + +### Example 2: Delete authorization in private cloud +```powershell +Get-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_authorization | Remove-AzVMwareAuthorization + +``` + +Delete authorization in private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the ExpressRoute Circuit Authorization in the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud +Aliases: AuthorizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwareCloudLink.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwareCloudLink.md new file mode 100644 index 000000000000..dee9abd6325e --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwareCloudLink.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecloudlink +schema: 2.0.0 +--- + +# Remove-AzVMwareCloudLink + +## SYNOPSIS +Delete a cloud link in a private cloud + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwareCloudLink -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareCloudLink -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a cloud link in a private cloud + +## EXAMPLES + +### Example 1: Delete a cloud link +```powershell +Remove-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +``` + +Delete a cloud link + +### Example 2: Delete a cloud link +```powershell +Get-AzVMwareCloudLink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_cloudlink | Remove-AzVMwareCloudLink + +``` + +Delete a cloud link + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the cloud link resource + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud +Aliases: CloudLinkName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwareCluster.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwareCluster.md new file mode 100644 index 000000000000..2a1df2823f35 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwareCluster.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecluster +schema: 2.0.0 +--- + +# Remove-AzVMwareCluster + +## SYNOPSIS +Delete a cluster in a private cloud + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwareCluster -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareCluster -Name -PrivateCloudInputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a cluster in a private cloud + +## EXAMPLES + +### Example 1: Delete cluster in private cloud +```powershell +Remove-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +``` + +Delete cluster in private cloud + +### Example 2: Delete cluster in private cloud +```powershell +Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareCluster + +``` + +Delete cluster in private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud +Aliases: ClusterName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwareDatastore.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwareDatastore.md new file mode 100644 index 000000000000..ed30dfcf22a5 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwareDatastore.md @@ -0,0 +1,291 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwaredatastore +schema: 2.0.0 +--- + +# Remove-AzVMwareDatastore + +## SYNOPSIS +Delete a datastore in a private cloud cluster + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwareDatastore -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwareDatastore -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityCluster +``` +Remove-AzVMwareDatastore -ClusterInputObject -Name [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a datastore in a private cloud cluster + +## EXAMPLES + +### Example 1: Delete a datastore in a private cloud cluster. +```powershell +Remove-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +Delete a datastore in a private cloud cluster. + +### Example 2: Delete a datastore in a private cloud cluster. +```powershell +Get-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareDatastore +``` + +Delete a datastore in a private cloud cluster. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the datastore in the private cloud cluster + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityCluster, DeleteViaIdentityPrivateCloud +Aliases: DatastoreName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwareGlobalReachConnection.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwareGlobalReachConnection.md new file mode 100644 index 000000000000..0f14e523f008 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwareGlobalReachConnection.md @@ -0,0 +1,256 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareglobalreachconnection +schema: 2.0.0 +--- + +# Remove-AzVMwareGlobalReachConnection + +## SYNOPSIS +Delete a global reach connection in a private cloud + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwareGlobalReachConnection -InputObject [-DefaultProfile ] [-AsJob] + [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a global reach connection in a private cloud + +## EXAMPLES + +### Example 1: Delete a global reach connection in a private cloud +```powershell +Remove-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group + +``` + +Delete a global reach connection in a private cloud + +### Example 2: Delete a global reach connection in a private cloud +```powershell +Get-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareGlobalReachConnection + +``` + +Delete a global reach connection in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the global reach connection in the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud +Aliases: GlobalReachConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwarePlacementPolicy.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwarePlacementPolicy.md new file mode 100644 index 000000000000..d55c0a54915d --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwarePlacementPolicy.md @@ -0,0 +1,293 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareplacementpolicy +schema: 2.0.0 +--- + +# Remove-AzVMwarePlacementPolicy + +## SYNOPSIS +Delete a placement policy in a private cloud cluster + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwarePlacementPolicy -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityCluster +``` +Remove-AzVMwarePlacementPolicy -ClusterInputObject -Name + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a placement policy in a private cloud cluster + +## EXAMPLES + +### Example 1: Delete a placement policy in a private cloud cluster +```powershell +Remove-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 + +``` + +Delete a placement policy in a private cloud cluster + +### Example 2: Delete a placement policy in a private cloud cluster +```powershell +Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 | Remove-AzVMwarePlacementPolicy + +``` + +Delete a placement policy in a private cloud cluster + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + +```yaml +Type: System.String +Parameter Sets: Delete, DeleteViaIdentityCluster, DeleteViaIdentityPrivateCloud +Aliases: PlacementPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Remove-AzVMwarePrivateCloud.md b/src/VMware/VMware.Autorest/help/Remove-AzVMwarePrivateCloud.md new file mode 100644 index 000000000000..04fc7a82c9e1 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Remove-AzVMwarePrivateCloud.md @@ -0,0 +1,217 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareprivatecloud +schema: 2.0.0 +--- + +# Remove-AzVMwarePrivateCloud + +## SYNOPSIS +Delete a private cloud + +## SYNTAX + +### Delete (Default) +``` +Remove-AzVMwarePrivateCloud -Name -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzVMwarePrivateCloud -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Delete a private cloud + +## EXAMPLES + +### Example 1: Delete private cloud +```powershell +Remove-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud + +``` + +Delete private cloud + +### Example 2: Delete private cloud +```powershell +Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud | Remove-AzVMwarePrivateCloud + +``` + +Delete private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PrivateCloudName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Test-AzVMwareLocationQuotaAvailability.md b/src/VMware/VMware.Autorest/help/Test-AzVMwareLocationQuotaAvailability.md new file mode 100644 index 000000000000..e554fcddc8db --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Test-AzVMwareLocationQuotaAvailability.md @@ -0,0 +1,129 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationquotaavailability +schema: 2.0.0 +--- + +# Test-AzVMwareLocationQuotaAvailability + +## SYNOPSIS +Return quota for subscription by region + +## SYNTAX + +``` +Test-AzVMwareLocationQuotaAvailability -Location [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Return quota for subscription by region + +## EXAMPLES + +### Example 1: Check quota availability +```powershell +Test-AzVMwareLocationQuotaAvailability -Location centralus +``` + +```output +Enabled +------- +Enabled +``` + +Check quota availability + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Azure region + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IQuota + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Test-AzVMwareLocationTrialAvailability.md b/src/VMware/VMware.Autorest/help/Test-AzVMwareLocationTrialAvailability.md new file mode 100644 index 000000000000..44b8eaaae4e6 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Test-AzVMwareLocationTrialAvailability.md @@ -0,0 +1,144 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability +schema: 2.0.0 +--- + +# Test-AzVMwareLocationTrialAvailability + +## SYNOPSIS +Return trial status for subscription by region + +## SYNTAX + +``` +Test-AzVMwareLocationTrialAvailability -Location [-SubscriptionId ] [-Name ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Return trial status for subscription by region + +## EXAMPLES + +### Example 1: Check trial availability +```powershell +Test-AzVMwareLocationTrialAvailability -Location westcentralus -Name av36 +``` + +```output +AvailableHost Status +------------- ------ +0 TrialDisabled +``` + +Check trial availability + +## PARAMETERS + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Azure region + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the SKU. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ITrial + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwareAuthorization.md b/src/VMware/VMware.Autorest/help/Update-AzVMwareAuthorization.md new file mode 100644 index 000000000000..44a09072afec --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwareAuthorization.md @@ -0,0 +1,243 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareauthorization +schema: 2.0.0 +--- + +# Update-AzVMwareAuthorization + +## SYNOPSIS +Create an ExpressRoute Circuit Authorization in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareAuthorization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create an ExpressRoute Circuit Authorization in a private cloud + +## EXAMPLES + +### Example 1: Update an ExpressRoute Circuit Authorization in a private cloud +```powershell +Update-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +ExpressRouteAuthorizationId : ExpressRouteURI +ExpressRouteId : ExpressRouteId +Id : Id +Key : GUID +Name : azps_test_authorization +ProvisioningState : Succeeded +ResourceGroupName : azps_test_group +Type : Microsoft.AVS/privateClouds/authorizations +``` + +Update an ExpressRoute Circuit Authorization in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the ExpressRoute Circuit Authorization in the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: AuthorizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwareCloudLink.md b/src/VMware/VMware.Autorest/help/Update-AzVMwareCloudLink.md new file mode 100644 index 000000000000..3879aa530ea4 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwareCloudLink.md @@ -0,0 +1,253 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecloudlink +schema: 2.0.0 +--- + +# Update-AzVMwareCloudLink + +## SYNOPSIS +Create a cloud link in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-LinkedCloud ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] + [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareCloudLink -InputObject [-LinkedCloud ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareCloudLink -Name -PrivateCloudInputObject [-LinkedCloud ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a cloud link in a private cloud + +## EXAMPLES + +### Example 1: Update a cloud link in a private cloud +```powershell +Update-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cloudlink Microsoft.AVS/privateClouds/cloudLinks azps_test_group +``` + +Update a cloud link in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkedCloud +Identifier of the other private cloud participating in the link. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the cloud link resource + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: CloudLinkName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwareCluster.md b/src/VMware/VMware.Autorest/help/Update-AzVMwareCluster.md new file mode 100644 index 000000000000..96d1c01c7c6b --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwareCluster.md @@ -0,0 +1,282 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecluster +schema: 2.0.0 +--- + +# Update-AzVMwareCluster + +## SYNOPSIS +Update a cluster in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-ClusterSize ] [-PropertiesHost ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareCluster -InputObject [-ClusterSize ] [-PropertiesHost ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareCluster -Name -PrivateCloudInputObject [-ClusterSize ] + [-PropertiesHost ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update a cluster in a private cloud + +## EXAMPLES + +### Example 1: Update cluster size by name +```powershell +Update-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -ClusterSize 4 +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cluster Microsoft.AVS/privateClouds/clusters azps_test_group +``` + +Update cluster size by name + +### Example 2: Update cluster size +```powershell +Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Update-AzVMwareCluster -ClusterSize 4 +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_cluster Microsoft.AVS/privateClouds/clusters azps_test_group +``` + +Update cluster size + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterSize +The cluster size + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: ClusterName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PropertiesHost +The hosts + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICluster + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwareDatastore.md b/src/VMware/VMware.Autorest/help/Update-AzVMwareDatastore.md new file mode 100644 index 000000000000..844abd856ed9 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwareDatastore.md @@ -0,0 +1,341 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwaredatastore +schema: 2.0.0 +--- + +# Update-AzVMwareDatastore + +## SYNOPSIS +Create a datastore in a private cloud cluster + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareDatastore -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityClusterExpanded +``` +Update-AzVMwareDatastore -ClusterInputObject -Name + [-DiskPoolVolumeLunName ] [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] + [-NetAppVolumeId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareDatastore -InputObject [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DiskPoolVolumeLunName ] [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] + [-NetAppVolumeId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Create a datastore in a private cloud cluster + +## EXAMPLES + +### Example 1: Update a datastore in a private cloud cluster. +```powershell +Update-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" +``` + +```output +Name Status ProvisioningState ResourceGroupName +---- ------ ----------------- ----------------- +azps_test_datastore Accessible Succeeded azps_test_group +``` + +Update a datastore in a private cloud cluster. + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeLunName +Name of the LUN to be used for datastore + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeMountOption +Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeTargetId +Azure resource ID of the iSCSI target + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the datastore in the private cloud cluster + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityClusterExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: DatastoreName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetAppVolumeId +Azure resource ID of the NetApp volume + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwareGlobalReachConnection.md b/src/VMware/VMware.Autorest/help/Update-AzVMwareGlobalReachConnection.md new file mode 100644 index 000000000000..8ee34825c10b --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwareGlobalReachConnection.md @@ -0,0 +1,286 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareglobalreachconnection +schema: 2.0.0 +--- + +# Update-AzVMwareGlobalReachConnection + +## SYNOPSIS +Create a global reach connection in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-AuthorizationKey ] [-ExpressRouteId ] + [-PeerExpressRouteCircuit ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareGlobalReachConnection -InputObject [-AuthorizationKey ] + [-ExpressRouteId ] [-PeerExpressRouteCircuit ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-AuthorizationKey ] [-ExpressRouteId ] [-PeerExpressRouteCircuit ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create a global reach connection in a private cloud + +## EXAMPLES + +### Example 1: Update a global reach connection in a private cloud +```powershell +Update-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +```output +Name Type ResourceGroupName +---- ---- ----------------- +azps_test_grc Microsoft.AVS/privateClouds/globalReachConnections azps_test_group +``` + +Update a global reach connection in a private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthorizationKey +Authorization key from the peer express route used for the global reach connection + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpressRouteId +The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the global reach connection in the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: GlobalReachConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PeerExpressRouteCircuit +Identifier of the ExpressRoute Circuit to peer with in the global reach connection + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwarePlacementPolicy.md b/src/VMware/VMware.Autorest/help/Update-AzVMwarePlacementPolicy.md new file mode 100644 index 000000000000..8a003056a3f5 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwarePlacementPolicy.md @@ -0,0 +1,369 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareplacementpolicy +schema: 2.0.0 +--- + +# Update-AzVMwarePlacementPolicy + +## SYNOPSIS +Update a placement policy in a private cloud cluster + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-AffinityStrength ] + [-AzureHybridBenefitType ] [-HostMember ] [-State ] [-VMMember ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityClusterExpanded +``` +Update-AzVMwarePlacementPolicy -ClusterInputObject -Name + [-AffinityStrength ] [-AzureHybridBenefitType ] [-HostMember ] [-State ] + [-VMMember ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwarePlacementPolicy -InputObject [-AffinityStrength ] + [-AzureHybridBenefitType ] [-HostMember ] [-State ] [-VMMember ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-AffinityStrength ] [-AzureHybridBenefitType ] [-HostMember ] [-State ] + [-VMMember ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Update a placement policy in a private cloud cluster + +## EXAMPLES + +### Example 1: Update a placement policy in a private cloud cluster +```powershell +Update-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 -State 'Enabled' +``` + +```output +Name ResourceGroupName +---- ----------------- +policy1 group1 +``` + +Update a placement policy in a private cloud cluster + +### Example 2: Update a placement policy in a private cloud cluster +```powershell +Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 | Update-AzVMwarePlacementPolicy -State 'Enabled' +``` + +```output +Name ResourceGroupName +---- ----------------- +policy1 group1 +``` + +Update a placement policy in a private cloud cluster + +## PARAMETERS + +### -AffinityStrength +vm-host placement policy affinity strength (should/must) + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureHybridBenefitType +placement policy azure hybrid benefit opt-in type + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HostMember +Host members list + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded, UpdateViaIdentityClusterExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: PlacementPolicyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -State +Whether the placement policy is enabled or disabled + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMMember +Virtual machine members list + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicy + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/help/Update-AzVMwarePrivateCloud.md b/src/VMware/VMware.Autorest/help/Update-AzVMwarePrivateCloud.md new file mode 100644 index 000000000000..195f47b6ba19 --- /dev/null +++ b/src/VMware/VMware.Autorest/help/Update-AzVMwarePrivateCloud.md @@ -0,0 +1,390 @@ +--- +external help file: +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareprivatecloud +schema: 2.0.0 +--- + +# Update-AzVMwarePrivateCloud + +## SYNOPSIS +Update a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwarePrivateCloud -Name -ResourceGroupName [-SubscriptionId ] + [-EncryptionStatus ] [-ExtendedNetworkBlock ] [-IdentitySource ] + [-IdentityType ] [-Internet ] [-KeyVaultPropertyKeyName ] + [-KeyVaultPropertyKeyVaultUrl ] [-KeyVaultPropertyKeyVersion ] + [-ManagementClusterHost ] [-ManagementClusterSize ] [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwarePrivateCloud -InputObject [-EncryptionStatus ] + [-ExtendedNetworkBlock ] [-IdentitySource ] [-IdentityType ] + [-Internet ] [-KeyVaultPropertyKeyName ] [-KeyVaultPropertyKeyVaultUrl ] + [-KeyVaultPropertyKeyVersion ] [-ManagementClusterHost ] [-ManagementClusterSize ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update a private cloud + +## EXAMPLES + +### Example 1: Update size of private cloud by name +```powershell +Update-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -ManagementClusterSize 4 +``` + +```output +Location Name Type ResourceGroupName +-------- ---- ---- ----------------- +australiaeast azps_test_cloud Microsoft.AVS/privateClouds azps_test_group +``` + +Update size of private cloud by name + +### Example 2: Update size of private cloud +```powershell +Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud | Update-AzVMwarePrivateCloud -ManagementClusterSize 4 +``` + +```output +Location Name Type ResourceGroupName +-------- ---- ---- ----------------- +australiaeast azps_test_cloud Microsoft.AVS/privateClouds azps_test_group +``` + +Update size of private cloud + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionStatus +Status of customer managed encryption key + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedNetworkBlock +Array of additional networks noncontiguous with networkBlock. +Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. +Make sure the CIDR format conforms to (A.B.C.D/X). + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentitySource +vCenter Single Sign On Identity Sources +To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +The type of identity used for the private cloud. +The type 'SystemAssigned' refers to an implicitly created identity. +The type 'None' will remove any identities from the Private Cloud. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Internet +Connectivity to internet is enabled or disabled + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyName +The name of the key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyVaultUrl +The URL of the vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyVersion +The version of the key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagementClusterHost +The hosts + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ManagementClusterSize +The cluster size + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the private cloud + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: PrivateCloudName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Resource tags + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud + +## NOTES + +## RELATED LINKS + diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareAddon.ps1 index 94ca4b67897b..e056d54d8624 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareAddon.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon #> function Get-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('AddonName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareAddon_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareAddon_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareAddon_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareAddon_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareOperation.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareOperation.ps1 index 1045f3ada2a7..c297743bffc0 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareOperation.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareOperation.ps1 @@ -25,12 +25,12 @@ Lists all of the available operations {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareoperation #> function Get-AzVMwareOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -38,7 +38,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptCmdlet.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptCmdlet.ps1 index 8226d465e911..6acc9eb18264 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptCmdlet.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptCmdlet.ps1 @@ -27,7 +27,7 @@ Return information about a script cmdlet resource in a specific package on a pri .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,73 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +SCRIPTPACKAGEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptcmdlet #> function Get-AzVMwareScriptCmdlet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityScriptPackage', Mandatory)] [Alias('ScriptCmdletName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -89,6 +148,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -110,12 +170,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityScriptPackage', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for SCRIPTPACKAGEINPUTOBJECT properties and create a hash table. + ${ScriptPackageInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -169,9 +244,11 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_GetViaIdentityPrivateCloud'; + GetViaIdentityScriptPackage = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_GetViaIdentityScriptPackage'; List = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecution.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecution.ps1 index 59f0b74ca982..117448f32e03 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecution.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecution.ps1 @@ -27,7 +27,7 @@ Get an script execution by name in a private cloud .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptexecution #> function Get-AzVMwareScriptExecution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('ScriptExecutionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptExecution_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptExecution_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptExecution_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareScriptExecution_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecutionLog.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecutionLog.ps1 index f0c8b38f6bb5..1ef80e5758f1 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecutionLog.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptExecutionLog.ps1 @@ -27,9 +27,9 @@ Return the logs for a script execution resource .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Inputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] +System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution .Notes COMPLEX PARAMETER PROPERTIES @@ -61,12 +61,41 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptexecutionlog #> function Get-AzVMwareScriptExecutionLog { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution])] -[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution])] +[CmdletBinding(DefaultParameterSetName='GetViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] @@ -82,6 +111,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the user-invoked script execution resource @@ -101,11 +131,18 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter(Mandatory, ValueFromPipeline)] [AllowEmptyCollection()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType])] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(Required, PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] # Array of ScriptOutputStreamType ${ScriptOutputStreamType}, @@ -114,7 +151,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -168,8 +206,9 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptExecutionLog_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptExecutionLog_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptPackage.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptPackage.ps1 index d8e98dd2f434..52d5b3f37090 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptPackage.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareScriptPackage.ps1 @@ -27,7 +27,7 @@ Get a script package available to run on a private cloud .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptpackage #> function Get-AzVMwareScriptPackage { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('ScriptPackageName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptPackage_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptPackage_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptPackage_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareScriptPackage_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetwork.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetwork.ps1 new file mode 100644 index 000000000000..b12531838996 --- /dev/null +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetwork.ps1 @@ -0,0 +1,194 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code +# is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get a private cloud workload network. +.Description +Get a private cloud workload network. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetwork +#> +function Get-AzVMwareWorkloadNetwork { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetwork_Get'; + GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetwork_GetViaIdentity'; + List = 'Az.VMware.private\Get-AzVMwareWorkloadNetwork_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDhcp.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDhcp.ps1 index bd58e768e95a..d318c6492a02 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDhcp.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDhcp.ps1 @@ -27,12 +27,40 @@ Get dhcp by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +DHCPCONFIGURATIONINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,11 +87,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdhcp #> function Get-AzVMwareWorkloadNetworkDhcp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -74,6 +103,7 @@ param( ${DhcpName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityDhcpConfiguration', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityDhcpConfiguration', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for DHCPCONFIGURATIONINPUTOBJECT properties and create a hash table. + ${DhcpConfigurationInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_GetViaIdentity'; + GetViaIdentityDhcpConfiguration = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsService.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsService.ps1 index 5a9b0b7cfceb..7ba6db6fb691 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsService.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsService.ps1 @@ -27,7 +27,7 @@ Get a DNS service by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdnsservice #> function Get-AzVMwareWorkloadNetworkDnsService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Service identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsZone.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsZone.ps1 index f49910440e45..9c6853f399a5 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsZone.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkDnsZone.ps1 @@ -27,7 +27,7 @@ Get a DNS zone by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdnszone #> function Get-AzVMwareWorkloadNetworkDnsZone { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Zone identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkGateway.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkGateway.ps1 index 4d79abe93896..a11a710d7a9a 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkGateway.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkGateway.ps1 @@ -27,7 +27,7 @@ Get a gateway by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkgateway #> function Get-AzVMwareWorkloadNetworkGateway { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Gateway identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPortMirroring.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPortMirroring.ps1 index 6cd154fd61db..a92717a3115f 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPortMirroring.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPortMirroring.ps1 @@ -27,7 +27,7 @@ Get a port mirroring profile by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkportmirroring #> function Get-AzVMwareWorkloadNetworkPortMirroring { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Port Mirroring identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPublicIP.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPublicIP.ps1 index 90a468e41f29..76ebbd843b2f 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPublicIP.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkPublicIP.ps1 @@ -27,7 +27,7 @@ Get a Public IP Block by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkpublicip #> function Get-AzVMwareWorkloadNetworkPublicIP { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -74,6 +103,7 @@ param( ${PrivateCloudName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Public IP Block identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkSegment.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkSegment.ps1 index d3eb6fb617b1..bc7b2f20ccba 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkSegment.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkSegment.ps1 @@ -27,7 +27,7 @@ Get a segment by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworksegment #> function Get-AzVMwareWorkloadNetworkSegment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -82,6 +111,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVM.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVM.ps1 index 953064fb30e6..731f421afa34 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVM.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVM.ps1 @@ -27,7 +27,7 @@ Get a virtual machine by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkvm #> function Get-AzVMwareWorkloadNetworkVM { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -90,6 +119,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Virtual Machine identifier @@ -102,12 +132,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -161,9 +199,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVMGroup.ps1 b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVMGroup.ps1 index c62b7ad3f3d9..20af1e30e37b 100644 --- a/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVMGroup.ps1 +++ b/src/VMware/VMware.Autorest/internal/Get-AzVMwareWorkloadNetworkVMGroup.ps1 @@ -27,7 +27,7 @@ Get a vm group by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkvmgroup #> function Get-AzVMwareWorkloadNetworkVMGroup { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -90,6 +119,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX VM Group identifier. @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Lock-AzVMwareVirtualMachineMovement.ps1 b/src/VMware/VMware.Autorest/internal/Lock-AzVMwareVirtualMachineMovement.ps1 index 11d80977d6ad..670663b10191 100644 --- a/src/VMware/VMware.Autorest/internal/Lock-AzVMwareVirtualMachineMovement.ps1 +++ b/src/VMware/VMware.Autorest/internal/Lock-AzVMwareVirtualMachineMovement.ps1 @@ -33,6 +33,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,6 +87,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/lock-azvmwarevirtualmachinemovement #> @@ -67,6 +124,7 @@ function Lock-AzVMwareVirtualMachineMovement { [CmdletBinding(DefaultParameterSetName='RestrictExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='RestrictViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the cluster in the private cloud @@ -93,11 +151,20 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='RestrictViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='RestrictViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Virtual Machine identifier ${VirtualMachineId}, + [Parameter(ParameterSetName='RestrictViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + [Parameter(ParameterSetName='RestrictViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] @@ -105,10 +172,17 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='RestrictViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState] + [System.String] # Whether VM DRS-driven movement is restricted (enabled) or not (disabled) ${RestrictMovement}, @@ -117,7 +191,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -182,9 +257,11 @@ begin { $mapping = @{ RestrictExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictExpanded'; + RestrictViaIdentityClusterExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded'; RestrictViaIdentityExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded'; + RestrictViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded'; } - if (('RestrictExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('RestrictExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareAddon.ps1 index 753937281404..62dec1ee83cb 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareAddon.ps1 @@ -16,59 +16,132 @@ <# .Synopsis -Create or update a addon in a private cloud +Create a addon in a private cloud .Description -Create or update a addon in a private cloud +Create a addon in a private cloud .Example $data = New-AzVMwareAddonVrPropertiesObject -VrsCount 2 New-AzVMwareAddon -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Property $data +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + PROPERTY : The properties of an addon resource - AddonType : The type of private cloud addon + AddonType : The type of private cloud addon .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon #> function New-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('AddonName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the addon for the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties] # The properties of an addon resource # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, @@ -78,7 +151,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -143,8 +217,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareAddon_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareAddon_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareAddon_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwarePrivateCloud.ps1 index 5ee49681ac53..5bec2aabffb8 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwarePrivateCloud.ps1 @@ -16,14 +16,14 @@ <# .Synopsis -Create or update a private cloud +Create a private cloud .Description -Create or update a private cloud +Create a private cloud .Example New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud .Notes COMPLEX PARAMETER PROPERTIES @@ -38,13 +38,13 @@ IDENTITYSOURCE : vCenter Single Sign On Identity Sources [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. [PrimaryServer ]: Primary server URL [SecondaryServer ]: Secondary server URL - [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud #> function New-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -81,9 +81,9 @@ param( ${AvailabilitySecondaryZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy] + [System.String] # The availability strategy for the private cloud ${AvailabilityStrategy}, @@ -94,33 +94,42 @@ param( ${AvailabilityZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState] + [System.String] # Status of customer managed encryption key ${EncryptionStatus}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]] + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] # vCenter Single Sign On Identity Sources # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. ${IdentitySource}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType] + [System.String] # The type of identity used for the private cloud. # The type 'SystemAssigned' refers to an implicitly created identity. # The type 'None' will remove any identities from the Private Cloud. ${IdentityType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, @@ -176,7 +185,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -192,7 +201,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -258,7 +268,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwarePrivateCloud_CreateExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareScriptExecution.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareScriptExecution.ps1 index 5a728df2068a..7c900812bee7 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareScriptExecution.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareScriptExecution.ps1 @@ -16,16 +16,18 @@ <# .Synopsis -Create or update a script execution in a private cloud +Create a script execution in a private cloud .Description -Create or update a script execution in a private cloud +Create a script execution in a private cloud .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution .Notes COMPLEX PARAMETER PROPERTIES @@ -33,45 +35,116 @@ To create the parameters described below, construct a hash table containing the HIDDENPARAMETER : Parameters that will be hidden/not visible to ARM, such as passwords and credentials Name : The parameter name - Type : The type of execution parameter + Type : The type of execution parameter + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud PARAMETER : Parameters the script will accept Name : The parameter name - Type : The type of execution parameter + Type : The type of execution parameter + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarescriptexecution #> function New-AzVMwareScriptExecution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('ScriptExecutionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the user-invoked script execution resource ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -81,14 +154,14 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[]] # Parameters that will be hidden/not visible to ARM, such as passwords and credentials # To construct, see NOTES section for HIDDENPARAMETER properties and create a hash table. ${HiddenParameter}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs]))] [System.Collections.Hashtable] # User-defined dictionary. ${NamedOutput}, @@ -103,7 +176,7 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[]] # Parameters the script will accept # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, @@ -132,7 +205,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -197,8 +271,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareScriptExecution_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareScriptExecution_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDhcp.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDhcp.ps1 index dfefe98fd75f..45488c0ec3cd 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDhcp.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDhcp.ps1 @@ -24,46 +24,123 @@ Create dhcp by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkdhcp #> function New-AzVMwareWorkloadNetworkDhcp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DHCP identifier. # Generally the same as the DHCP display name ${DhcpName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum] + [System.String] # Type of DHCP: SERVER or RELAY. ${DhcpType}, @@ -84,7 +161,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -149,8 +227,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDhcp_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsService.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsService.ps1 index e3ebbf3b6e2d..ba6eadab49d1 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsService.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsService.ps1 @@ -24,42 +24,119 @@ Create a DNS service by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkdnsservice #> function New-AzVMwareWorkloadNetworkDnsService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Service identifier. # Generally the same as the DNS Service's display name ${DnsServiceName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -86,9 +163,9 @@ param( ${FqdnZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum] + [System.String] # DNS Service log level. ${LogLevel}, @@ -103,7 +180,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -168,8 +246,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsService_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsZone.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsZone.ps1 index 060786690450..05091f5deea3 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsZone.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkDnsZone.ps1 @@ -24,42 +24,119 @@ Create a DNS zone by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkdnszone #> function New-AzVMwareWorkloadNetworkDnsZone { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Zone identifier. # Generally the same as the DNS Zone's display name ${DnsZoneName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -103,7 +180,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -168,8 +246,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsZone_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPortMirroring.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPortMirroring.ps1 index 25ed29339600..e5eae2b7e691 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPortMirroring.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPortMirroring.ps1 @@ -24,42 +24,119 @@ Create a port mirroring profile by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkportmirroring #> function New-AzVMwareWorkloadNetworkPortMirroring { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Port Mirroring identifier. # Generally the same as the Port Mirroring display name ${PortMirroringName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -67,9 +144,9 @@ param( ${Destination}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum] + [System.String] # Direction of port mirroring profile. ${Direction}, @@ -96,7 +173,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -161,8 +239,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPortMirroring_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPublicIP.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPublicIP.ps1 index e5c4b5c061b7..e73f618f9908 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPublicIP.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkPublicIP.ps1 @@ -24,42 +24,119 @@ Create a Public IP Block by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkpublicip #> function New-AzVMwareWorkloadNetworkPublicIP { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Public IP Block identifier. # Generally the same as the Public IP Block's display name ${PublicIPName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -77,7 +154,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -142,8 +220,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPublicIP_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkSegment.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkSegment.ps1 index 85a22575dbf9..827d059a8f59 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkSegment.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkSegment.ps1 @@ -24,42 +24,119 @@ Create a segment by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworksegment #> function New-AzVMwareWorkloadNetworkSegment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. # Generally the same as the Segment's display name ${SegmentName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -96,7 +173,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -161,8 +239,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkSegment_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkVMGroup.ps1 b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkVMGroup.ps1 index 8c6bbbdf20c3..292a3d762641 100644 --- a/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkVMGroup.ps1 +++ b/src/VMware/VMware.Autorest/internal/New-AzVMwareWorkloadNetworkVMGroup.ps1 @@ -24,41 +24,118 @@ Create a vm group by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkvmgroup #> function New-AzVMwareWorkloadNetworkVMGroup { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX VM Group identifier. # Generally the same as the VM Group's display name ${VMGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] @@ -84,7 +161,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -149,8 +227,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkVMGroup_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/ProxyCmdletDefinitions.ps1 b/src/VMware/VMware.Autorest/internal/ProxyCmdletDefinitions.ps1 index c21b28ea9bfe..c55024e67955 100644 --- a/src/VMware/VMware.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/src/VMware/VMware.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -27,7 +27,7 @@ Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon #> function Get-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('AddonName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -103,12 +133,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -162,9 +200,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareAddon_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareAddon_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareAddon_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareAddon_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -209,12 +248,12 @@ Lists all of the available operations {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareoperation #> function Get-AzVMwareOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -222,7 +261,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -320,7 +360,7 @@ Return information about a script cmdlet resource in a specific package on a pri .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet .Notes COMPLEX PARAMETER PROPERTIES @@ -352,14 +392,73 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +SCRIPTPACKAGEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptcmdlet #> function Get-AzVMwareScriptCmdlet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptCmdlet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptCmdlet])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityScriptPackage', Mandatory)] [Alias('ScriptCmdletName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -382,6 +481,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -403,12 +503,27 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + + [Parameter(ParameterSetName='GetViaIdentityScriptPackage', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for SCRIPTPACKAGEINPUTOBJECT properties and create a hash table. + ${ScriptPackageInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -462,9 +577,11 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_GetViaIdentityPrivateCloud'; + GetViaIdentityScriptPackage = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_GetViaIdentityScriptPackage'; List = 'Az.VMware.private\Get-AzVMwareScriptCmdlet_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -511,9 +628,9 @@ Return the logs for a script execution resource .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Inputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[] +System.Collections.Generic.List`1[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution .Notes COMPLEX PARAMETER PROPERTIES @@ -545,12 +662,41 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptexecutionlog #> function Get-AzVMwareScriptExecutionLog { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution])] -[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution])] +[CmdletBinding(DefaultParameterSetName='GetViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Get', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] @@ -566,6 +712,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the user-invoked script execution resource @@ -585,11 +732,18 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter(Mandatory, ValueFromPipeline)] [AllowEmptyCollection()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType])] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ScriptOutputStreamType[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(Required, PossibleTypes=([System.String]))] + [System.Collections.Generic.List[System.String]] # Array of ScriptOutputStreamType ${ScriptOutputStreamType}, @@ -598,7 +752,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -652,8 +807,9 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptExecutionLog_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptExecutionLog_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptExecutionLog_GetViaIdentityPrivateCloud'; } - if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -700,7 +856,7 @@ Get an script execution by name in a private cloud .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution .Notes COMPLEX PARAMETER PROPERTIES @@ -732,14 +888,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptexecution #> function Get-AzVMwareScriptExecution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('ScriptExecutionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -776,12 +962,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -835,9 +1029,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptExecution_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptExecution_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptExecution_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareScriptExecution_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -884,7 +1079,7 @@ Get a script package available to run on a private cloud .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage .Notes COMPLEX PARAMETER PROPERTIES @@ -916,14 +1111,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarescriptpackage #> function Get-AzVMwareScriptPackage { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptPackage])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptPackage])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Alias('ScriptPackageName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -960,12 +1185,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1019,9 +1252,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareScriptPackage_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareScriptPackage_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareScriptPackage_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareScriptPackage_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -1068,12 +1302,40 @@ Get dhcp by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +DHCPCONFIGURATIONINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -1100,11 +1362,12 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdhcp #> function Get-AzVMwareWorkloadNetworkDhcp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1115,6 +1378,7 @@ param( ${DhcpName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityDhcpConfiguration', Mandatory)] [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -1144,12 +1408,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityDhcpConfiguration', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for DHCPCONFIGURATIONINPUTOBJECT properties and create a hash table. + ${DhcpConfigurationInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1203,9 +1475,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_GetViaIdentity'; + GetViaIdentityDhcpConfiguration = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_GetViaIdentityDhcpConfiguration'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDhcp_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -1252,7 +1525,7 @@ Get a DNS service by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService .Notes COMPLEX PARAMETER PROPERTIES @@ -1284,14 +1557,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdnsservice #> function Get-AzVMwareWorkloadNetworkDnsService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Service identifier. @@ -1328,12 +1631,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1387,9 +1698,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsService_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -1436,7 +1748,7 @@ Get a DNS zone by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone .Notes COMPLEX PARAMETER PROPERTIES @@ -1468,24 +1780,54 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier -.Link -https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdnszone -#> -function Get-AzVMwareWorkloadNetworkDnsZone { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone])] -[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] -param( - [Parameter(ParameterSetName='Get', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # NSX DNS Zone identifier. - # Generally the same as the DNS Zone's display name - ${DnsZoneName}, + [WorkloadNetworkName ]: Name for the workload network in the private cloud - [Parameter(ParameterSetName='Get', Mandatory)] - [Parameter(ParameterSetName='List', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkdnszone +#> +function Get-AzVMwareWorkloadNetworkDnsZone { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # NSX DNS Zone identifier. + # Generally the same as the DNS Zone's display name + ${DnsZoneName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] # Name of the private cloud ${PrivateCloudName}, @@ -1512,12 +1854,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1571,9 +1921,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkDnsZone_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -1620,7 +1971,7 @@ Get a gateway by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway .Notes COMPLEX PARAMETER PROPERTIES @@ -1652,14 +2003,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkgateway #> function Get-AzVMwareWorkloadNetworkGateway { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkGateway])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkGateway])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Gateway identifier. @@ -1696,12 +2077,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1755,9 +2144,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkGateway_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -1804,7 +2194,7 @@ Get a port mirroring profile by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring .Notes COMPLEX PARAMETER PROPERTIES @@ -1836,14 +2226,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkportmirroring #> function Get-AzVMwareWorkloadNetworkPortMirroring { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Port Mirroring identifier. @@ -1880,12 +2300,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -1939,9 +2367,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPortMirroring_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -1988,7 +2417,7 @@ Get a Public IP Block by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP .Notes COMPLEX PARAMETER PROPERTIES @@ -2020,11 +2449,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkpublicip #> function Get-AzVMwareWorkloadNetworkPublicIP { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -2035,6 +2493,7 @@ param( ${PrivateCloudName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Public IP Block identifier. @@ -2064,12 +2523,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2123,9 +2590,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkPublicIP_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -2172,7 +2640,7 @@ Get a segment by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment .Notes COMPLEX PARAMETER PROPERTIES @@ -2204,11 +2672,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworksegment #> function Get-AzVMwareWorkloadNetworkSegment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -2227,6 +2724,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. @@ -2248,12 +2746,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2307,9 +2813,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkSegment_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -2356,7 +2863,7 @@ Get a vm group by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -2388,11 +2895,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkvmgroup #> function Get-AzVMwareWorkloadNetworkVMGroup { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -2419,6 +2955,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX VM Group identifier. @@ -2432,12 +2969,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2491,9 +3036,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVMGroup_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -2540,7 +3086,7 @@ Get a virtual machine by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -2572,11 +3118,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetworkvm #> function Get-AzVMwareWorkloadNetworkVM { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVirtualMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -2603,6 +3178,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Virtual Machine identifier @@ -2615,12 +3191,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter(DontShow)] @@ -2674,9 +3258,10 @@ begin { $mapping = @{ Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_Get'; GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_GetViaIdentity'; + GetViaIdentityPrivateCloud = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_GetViaIdentityPrivateCloud'; List = 'Az.VMware.private\Get-AzVMwareWorkloadNetworkVM_List'; } - if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -2712,9 +3297,9 @@ end { <# .Synopsis -Enable or disable DRS-driven VM movement restriction +Get a private cloud workload network. .Description -Enable or disable DRS-driven VM movement restriction +Get a private cloud workload network. .Example {{ Add code here }} .Example @@ -2723,7 +3308,7 @@ Enable or disable DRS-driven VM movement restriction .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -System.Boolean +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -2755,45 +3340,291 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link -https://learn.microsoft.com/powershell/module/az.vmware/lock-azvmwarevirtualmachinemovement +https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareworkloadnetwork #> -function Lock-AzVMwareVirtualMachineMovement { -[OutputType([System.Boolean])] -[CmdletBinding(DefaultParameterSetName='RestrictExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +function Get-AzVMwareWorkloadNetwork { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetwork])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] param( - [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Name of the cluster in the private cloud - ${ClusterName}, - - [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(ParameterSetName='RestrictExpanded')] + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] + [System.String[]] # The ID of the target subscription. ${SubscriptionId}, - [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [System.String] - # Virtual Machine identifier - ${VirtualMachineId}, - + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] + [System.Management.Automation.PSObject] + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + Get = 'Az.VMware.private\Get-AzVMwareWorkloadNetwork_Get'; + GetViaIdentity = 'Az.VMware.private\Get-AzVMwareWorkloadNetwork_GetViaIdentity'; + List = 'Az.VMware.private\Get-AzVMwareWorkloadNetwork_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} + +<# +.Synopsis +Enable or disable DRS-driven VM movement restriction +.Description +Enable or disable DRS-driven VM movement restriction +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud +.Link +https://learn.microsoft.com/powershell/module/az.vmware/lock-azvmwarevirtualmachinemovement +#> +function Lock-AzVMwareVirtualMachineMovement { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='RestrictExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='RestrictViaIdentityPrivateCloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the cluster in the private cloud + ${ClusterName}, + + [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Name of the private cloud + ${PrivateCloudName}, + + [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # The name of the resource group. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='RestrictExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RestrictExpanded', Mandatory)] + [Parameter(ParameterSetName='RestrictViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='RestrictViaIdentityPrivateCloudExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [System.String] + # Virtual Machine identifier + ${VirtualMachineId}, + + [Parameter(ParameterSetName='RestrictViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + ${ClusterInputObject}, + [Parameter(ParameterSetName='RestrictViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] @@ -2801,10 +3632,17 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='RestrictViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.VirtualMachineRestrictMovementState] + [System.String] # Whether VM DRS-driven movement is restricted (enabled) or not (disabled) ${RestrictMovement}, @@ -2813,7 +3651,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -2878,9 +3717,11 @@ begin { $mapping = @{ RestrictExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictExpanded'; + RestrictViaIdentityClusterExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictViaIdentityClusterExpanded'; RestrictViaIdentityExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictViaIdentityExpanded'; + RestrictViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Lock-AzVMwareVirtualMachineMovement_RestrictViaIdentityPrivateCloudExpanded'; } - if (('RestrictExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('RestrictExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -2916,59 +3757,132 @@ end { <# .Synopsis -Create or update a addon in a private cloud +Create a addon in a private cloud .Description -Create or update a addon in a private cloud +Create a addon in a private cloud .Example $data = New-AzVMwareAddonVrPropertiesObject -VrsCount 2 New-AzVMwareAddon -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Property $data +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + PROPERTY : The properties of an addon resource - AddonType : The type of private cloud addon + AddonType : The type of private cloud addon .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon #> function New-AzVMwareAddon { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddon])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddon])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('AddonName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the addon for the private cloud ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties] # The properties of an addon resource # To construct, see NOTES section for PROPERTY properties and create a hash table. ${Property}, @@ -2978,7 +3892,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3043,8 +3958,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareAddon_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareAddon_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareAddon_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -3080,14 +3997,14 @@ end { <# .Synopsis -Create or update a private cloud +Create a private cloud .Description -Create or update a private cloud +Create a private cloud .Example New-AzVMwarePrivateCloud -Name azps_test_cloud -ResourceGroupName azps_test_group -NetworkBlock 192.168.48.0/22 -Sku av36 -ManagementClusterSize 3 -Location australiaeast .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud .Notes COMPLEX PARAMETER PROPERTIES @@ -3102,13 +4019,13 @@ IDENTITYSOURCE : vCenter Single Sign On Identity Sources [Password ]: The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. [PrimaryServer ]: Primary server URL [SecondaryServer ]: Secondary server URL - [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) + [Ssl ]: Protect LDAP communication using SSL certificate (LDAPS) [Username ]: The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud #> function New-AzVMwarePrivateCloud { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPrivateCloud])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPrivateCloud])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -3145,9 +4062,9 @@ param( ${AvailabilitySecondaryZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SingleZone", "DualZone")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy] + [System.String] # The availability strategy for the private cloud ${AvailabilityStrategy}, @@ -3158,33 +4075,42 @@ param( ${AvailabilityZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState] + [System.String] # Status of customer managed encryption key ${EncryptionStatus}, [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[]] + [System.String[]] + # Array of additional networks noncontiguous with networkBlock. + # Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. + # Make sure the CIDR format conforms to (A.B.C.D/X). + ${ExtendedNetworkBlock}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[]] # vCenter Single Sign On Identity Sources # To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. ${IdentitySource}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SystemAssigned", "None")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType] + [System.String] # The type of identity used for the private cloud. # The type 'SystemAssigned' refers to an implicitly created identity. # The type 'None' will remove any identities from the Private Cloud. ${IdentityType}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("Enabled", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum] + [System.String] # Connectivity to internet is enabled or disabled ${Internet}, @@ -3240,7 +4166,7 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IResourceTags]))] [System.Collections.Hashtable] # Resource tags ${Tag}, @@ -3256,7 +4182,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3322,7 +4249,7 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwarePrivateCloud_CreateExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -3358,16 +4285,18 @@ end { <# .Synopsis -Create or update a script execution in a private cloud +Create a script execution in a private cloud .Description -Create or update a script execution in a private cloud +Create a script execution in a private cloud .Example {{ Add code here }} .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution .Notes COMPLEX PARAMETER PROPERTIES @@ -3375,45 +4304,116 @@ To create the parameters described below, construct a hash table containing the HIDDENPARAMETER : Parameters that will be hidden/not visible to ARM, such as passwords and credentials Name : The parameter name - Type : The type of execution parameter + Type : The type of execution parameter + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud PARAMETER : Parameters the script will accept Name : The parameter name - Type : The type of execution parameter + Type : The type of execution parameter + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarescriptexecution #> function New-AzVMwareScriptExecution { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecution])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecution])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Alias('ScriptExecutionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the user-invoked script execution resource ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the private cloud. ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -3423,14 +4423,14 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[]] # Parameters that will be hidden/not visible to ARM, such as passwords and credentials # To construct, see NOTES section for HIDDENPARAMETER properties and create a hash table. ${HiddenParameter}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionPropertiesNamedOutputs]))] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionPropertiesNamedOutputs]))] [System.Collections.Hashtable] # User-defined dictionary. ${NamedOutput}, @@ -3445,7 +4445,7 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IScriptExecutionParameter[]] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IScriptExecutionParameter[]] # Parameters the script will accept # To construct, see NOTES section for PARAMETER properties and create a hash table. ${Parameter}, @@ -3474,7 +4474,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3539,8 +4540,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareScriptExecution_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareScriptExecution_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareScriptExecution_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -3584,46 +4587,123 @@ Create dhcp by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkdhcp #> function New-AzVMwareWorkloadNetworkDhcp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DHCP identifier. # Generally the same as the DHCP display name ${DhcpName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum] + [System.String] # Type of DHCP: SERVER or RELAY. ${DhcpType}, @@ -3644,7 +4724,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3709,8 +4790,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDhcp_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDhcp_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDhcp_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -3754,42 +4837,119 @@ Create a DNS service by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkdnsservice #> function New-AzVMwareWorkloadNetworkDnsService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Service identifier. # Generally the same as the DNS Service's display name ${DnsServiceName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -3816,9 +4976,9 @@ param( ${FqdnZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum] + [System.String] # DNS Service log level. ${LogLevel}, @@ -3833,7 +4993,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -3898,8 +5059,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsService_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsService_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsService_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -3943,42 +5106,119 @@ Create a DNS zone by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkdnszone #> function New-AzVMwareWorkloadNetworkDnsZone { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Zone identifier. # Generally the same as the DNS Zone's display name ${DnsZoneName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -4022,7 +5262,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4087,8 +5328,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsZone_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsZone_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkDnsZone_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -4132,42 +5375,119 @@ Create a port mirroring profile by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkportmirroring #> function New-AzVMwareWorkloadNetworkPortMirroring { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Port Mirroring identifier. # Generally the same as the Port Mirroring display name ${PortMirroringName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -4175,9 +5495,9 @@ param( ${Destination}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum] + [System.String] # Direction of port mirroring profile. ${Direction}, @@ -4204,7 +5524,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4269,8 +5590,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPortMirroring_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPortMirroring_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -4314,42 +5637,119 @@ Create a Public IP Block by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkpublicip #> function New-AzVMwareWorkloadNetworkPublicIP { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPublicIP])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPublicIP])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Public IP Block identifier. # Generally the same as the Public IP Block's display name ${PublicIPName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -4367,7 +5767,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4432,8 +5833,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPublicIP_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPublicIP_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkPublicIP_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -4477,42 +5880,119 @@ Create a segment by id in a private cloud workload network. .Example {{ Add code here }} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworksegment #> function New-AzVMwareWorkloadNetworkSegment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. # Generally the same as the Segment's display name ${SegmentName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] # The ID of the target subscription. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -4549,7 +6029,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4614,8 +6095,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkSegment_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkSegment_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkSegment_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -4659,41 +6142,118 @@ Create a vm group by id in a private cloud workload network. .Example {{ Add code here }} -.Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareworkloadnetworkvmgroup #> function New-AzVMwareWorkloadNetworkVMGroup { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud ${PrivateCloudName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX VM Group identifier. # Generally the same as the VM Group's display name ${VMGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] - [System.String] - # The ID of the target subscription. - ${SubscriptionId}, + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='CreateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] @@ -4719,7 +6279,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4784,8 +6345,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkVMGroup_CreateExpanded'; + CreateViaIdentityExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkVMGroup_CreateViaIdentityExpanded'; + CreateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\New-AzVMwareWorkloadNetworkVMGroup_CreateViaIdentityPrivateCloudExpanded'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -4866,6 +6429,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareaddon #> @@ -4874,6 +6466,7 @@ function Remove-AzVMwareAddon { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('AddonName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -4907,12 +6500,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -4984,8 +6585,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareAddon_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareAddon_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareAddon_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -5066,6 +6668,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareprivatecloud #> @@ -5106,7 +6709,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5179,7 +6783,7 @@ begin { Delete = 'Az.VMware.private\Remove-AzVMwarePrivateCloud_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwarePrivateCloud_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -5258,6 +6862,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarescriptexecution #> @@ -5266,6 +6899,7 @@ function Remove-AzVMwareScriptExecution { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('ScriptExecutionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -5299,12 +6933,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5376,8 +7018,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareScriptExecution_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareScriptExecution_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareScriptExecution_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -5456,6 +7099,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkdhcp #> @@ -5464,6 +7136,7 @@ function Remove-AzVMwareWorkloadNetworkDhcp { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DHCP identifier. @@ -5497,12 +7170,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5574,8 +7255,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDhcp_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDhcp_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -5628,6 +7310,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +DNSSERVICEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -5654,6 +7364,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkdnsservice #> @@ -5669,6 +7380,7 @@ param( ${DnsServiceName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityDnsService', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -5695,12 +7407,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityDnsService', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for DNSSERVICEINPUTOBJECT properties and create a hash table. + ${DnsServiceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5772,8 +7492,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsService_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsService_DeleteViaIdentity'; + DeleteViaIdentityDnsService = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -5826,6 +7547,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +DNSZONEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -5852,6 +7601,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkdnszone #> @@ -5867,6 +7617,7 @@ param( ${DnsZoneName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityDnsZone', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -5893,12 +7644,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityDnsZone', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for DNSZONEINPUTOBJECT properties and create a hash table. + ${DnsZoneInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -5970,8 +7729,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsZone_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity'; + DeleteViaIdentityDnsZone = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -6050,6 +7810,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PORTMIRRORINGPROFILEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkportmirroring #> @@ -6065,6 +7854,7 @@ param( ${PortMirroringName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPortMirroringProfile', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -6091,12 +7881,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPortMirroringProfile', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PORTMIRRORINGPROFILEINPUTOBJECT properties and create a hash table. + ${PortMirroringProfileInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -6168,8 +7966,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPortMirroring_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity'; + DeleteViaIdentityPortMirroringProfile = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -6222,7 +8021,35 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. -INPUTOBJECT : Identity Parameter +INPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PUBLICIPINPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud [CloudLinkName ]: Name of the cloud link resource @@ -6248,6 +8075,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkpublicip #> @@ -6256,6 +8084,7 @@ function Remove-AzVMwareWorkloadNetworkPublicIP { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPublicIP', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -6289,12 +8118,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPublicIP', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PUBLICIPINPUTOBJECT properties and create a hash table. + ${PublicIPInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -6366,8 +8203,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPublicIP_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity'; + DeleteViaIdentityPublicIP = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -6446,6 +8284,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworksegment #> @@ -6467,6 +8334,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. @@ -6487,12 +8355,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -6564,8 +8440,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkSegment_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkSegment_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -6644,6 +8521,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +VMGROUPINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkvmgroup #> @@ -6652,6 +8558,7 @@ function Remove-AzVMwareWorkloadNetworkVMGroup { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityVMGroup', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -6685,12 +8592,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityVMGroup', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for VMGROUPINPUTOBJECT properties and create a hash table. + ${VMGroupInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -6762,8 +8677,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkVMGroup_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity'; + DeleteViaIdentityVMGroup = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -6799,9 +8715,9 @@ end { <# .Synopsis -Create or update dhcp by id in a private cloud workload network. +Update dhcp by id in a private cloud workload network. .Description -Create or update dhcp by id in a private cloud workload network. +Update dhcp by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -6810,7 +8726,7 @@ Create or update dhcp by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp .Notes COMPLEX PARAMETER PROPERTIES @@ -6842,14 +8758,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkdhcp #> function Update-AzVMwareWorkloadNetworkDhcp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DHCP identifier. @@ -6883,10 +8829,17 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum] + [System.String] # Type of DHCP: SERVER or RELAY. ${DhcpType}, @@ -6907,7 +8860,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -6973,8 +8927,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDhcp_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -7010,9 +8965,9 @@ end { <# .Synopsis -Create or update a DNS service by id in a private cloud workload network. +Update a DNS service by id in a private cloud workload network. .Description -Create or update a DNS service by id in a private cloud workload network. +Update a DNS service by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -7021,7 +8976,7 @@ Create or update a DNS service by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService .Notes COMPLEX PARAMETER PROPERTIES @@ -7053,14 +9008,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkdnsservice #> function Update-AzVMwareWorkloadNetworkDnsService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Service identifier. @@ -7094,6 +9079,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -7120,9 +9112,9 @@ param( ${FqdnZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum] + [System.String] # DNS Service log level. ${LogLevel}, @@ -7137,7 +9129,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -7203,8 +9196,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -7240,9 +9234,9 @@ end { <# .Synopsis -Create or update a DNS zone by id in a private cloud workload network. +Update a DNS zone by id in a private cloud workload network. .Description -Create or update a DNS zone by id in a private cloud workload network. +Update a DNS zone by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -7251,7 +9245,7 @@ Create or update a DNS zone by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone .Notes COMPLEX PARAMETER PROPERTIES @@ -7283,14 +9277,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkdnszone #> function Update-AzVMwareWorkloadNetworkDnsZone { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Zone identifier. @@ -7324,6 +9348,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -7367,7 +9398,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -7433,8 +9465,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsZone_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -7470,9 +9503,9 @@ end { <# .Synopsis -Create or update a port mirroring profile by id in a private cloud workload network. +Update a port mirroring profile by id in a private cloud workload network. .Description -Create or update a port mirroring profile by id in a private cloud workload network. +Update a port mirroring profile by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -7481,7 +9514,7 @@ Create or update a port mirroring profile by id in a private cloud workload netw .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring .Notes COMPLEX PARAMETER PROPERTIES @@ -7513,14 +9546,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkportmirroring #> function Update-AzVMwareWorkloadNetworkPortMirroring { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Port Mirroring identifier. @@ -7554,6 +9617,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -7561,9 +9631,9 @@ param( ${Destination}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum] + [System.String] # Direction of port mirroring profile. ${Direction}, @@ -7590,7 +9660,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -7656,8 +9727,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkPortMirroring_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -7693,9 +9765,9 @@ end { <# .Synopsis -Create or update a segment by id in a private cloud workload network. +Update a segment by id in a private cloud workload network. .Description -Create or update a segment by id in a private cloud workload network. +Update a segment by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -7704,7 +9776,7 @@ Create or update a segment by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment .Notes COMPLEX PARAMETER PROPERTIES @@ -7736,11 +9808,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworksegment #> function Update-AzVMwareWorkloadNetworkSegment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -7757,6 +9858,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. @@ -7777,6 +9879,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -7813,7 +9922,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -7879,8 +9989,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkSegment_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } @@ -7916,9 +10027,9 @@ end { <# .Synopsis -Create or update a vm group by id in a private cloud workload network. +Update a vm group by id in a private cloud workload network. .Description -Create or update a vm group by id in a private cloud workload network. +Update a vm group by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -7927,7 +10038,7 @@ Create or update a vm group by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -7959,11 +10070,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkvmgroup #> function Update-AzVMwareWorkloadNetworkVMGroup { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -7987,6 +10127,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX VM Group identifier. @@ -8000,6 +10141,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -8024,7 +10172,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -8090,8 +10239,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkVMGroup_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareAddon.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareAddon.ps1 index 24a2526cf0d5..0d8f5c4c7be8 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareAddon.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareAddon.ps1 @@ -61,6 +61,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareaddon #> @@ -69,6 +98,7 @@ function Remove-AzVMwareAddon { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('AddonName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -102,12 +132,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -179,8 +217,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareAddon_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareAddon_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareAddon_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwarePrivateCloud.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwarePrivateCloud.ps1 index 7e7170edffff..7697740ce4e6 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwarePrivateCloud.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwarePrivateCloud.ps1 @@ -61,6 +61,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareprivatecloud #> @@ -101,7 +102,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -174,7 +176,7 @@ begin { Delete = 'Az.VMware.private\Remove-AzVMwarePrivateCloud_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwarePrivateCloud_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareScriptExecution.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareScriptExecution.ps1 index c17aa711b890..ebd24323a84d 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareScriptExecution.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareScriptExecution.ps1 @@ -59,6 +59,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarescriptexecution #> @@ -67,6 +96,7 @@ function Remove-AzVMwareScriptExecution { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Alias('ScriptExecutionName')] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareScriptExecution_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareScriptExecution_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareScriptExecution_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDhcp.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDhcp.ps1 index 00b8ec5f6d7f..74f8051e7b9c 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDhcp.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDhcp.ps1 @@ -59,6 +59,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkdhcp #> @@ -67,6 +96,7 @@ function Remove-AzVMwareWorkloadNetworkDhcp { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DHCP identifier. @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDhcp_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDhcp_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDhcp_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsService.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsService.ps1 index cba88b17f1b4..43dd12bbef05 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsService.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsService.ps1 @@ -33,6 +33,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +DNSSERVICEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,6 +87,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkdnsservice #> @@ -74,6 +103,7 @@ param( ${DnsServiceName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityDnsService', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityDnsService', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for DNSSERVICEINPUTOBJECT properties and create a hash table. + ${DnsServiceInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsService_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsService_DeleteViaIdentity'; + DeleteViaIdentityDnsService = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsService_DeleteViaIdentityDnsService'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsZone.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsZone.ps1 index 24e4b88d755b..cb9fbea2d363 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsZone.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkDnsZone.ps1 @@ -33,6 +33,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. +DNSZONEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + INPUTOBJECT : Identity Parameter [AddonName ]: Name of the addon for the private cloud [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud @@ -59,6 +87,7 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkdnszone #> @@ -74,6 +103,7 @@ param( ${DnsZoneName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityDnsZone', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityDnsZone', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for DNSZONEINPUTOBJECT properties and create a hash table. + ${DnsZoneInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsZone_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsZone_DeleteViaIdentity'; + DeleteViaIdentityDnsZone = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkDnsZone_DeleteViaIdentityDnsZone'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPortMirroring.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPortMirroring.ps1 index 8c2aca2757e5..0d6b12c7435d 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPortMirroring.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPortMirroring.ps1 @@ -59,6 +59,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PORTMIRRORINGPROFILEINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkportmirroring #> @@ -74,6 +103,7 @@ param( ${PortMirroringName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPortMirroringProfile', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPortMirroringProfile', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PORTMIRRORINGPROFILEINPUTOBJECT properties and create a hash table. + ${PortMirroringProfileInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPortMirroring_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentity'; + DeleteViaIdentityPortMirroringProfile = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPortMirroring_DeleteViaIdentityPortMirroringProfile'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPublicIP.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPublicIP.ps1 index 7f98bd012fa3..6e368c271cb0 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPublicIP.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkPublicIP.ps1 @@ -59,6 +59,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PUBLICIPINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkpublicip #> @@ -67,6 +96,7 @@ function Remove-AzVMwareWorkloadNetworkPublicIP { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPublicIP', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPublicIP', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PUBLICIPINPUTOBJECT properties and create a hash table. + ${PublicIPInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPublicIP_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPublicIP_DeleteViaIdentity'; + DeleteViaIdentityPublicIP = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkPublicIP_DeleteViaIdentityPublicIP'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkSegment.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkSegment.ps1 index eafee2502476..aeb9091e7dee 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkSegment.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkSegment.ps1 @@ -59,6 +59,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworksegment #> @@ -80,6 +109,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityPrivateCloud', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkSegment_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkSegment_DeleteViaIdentity'; + DeleteViaIdentityPrivateCloud = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkSegment_DeleteViaIdentityPrivateCloud'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkVMGroup.ps1 b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkVMGroup.ps1 index 9bede8e12fa1..05becd3b6393 100644 --- a/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkVMGroup.ps1 +++ b/src/VMware/VMware.Autorest/internal/Remove-AzVMwareWorkloadNetworkVMGroup.ps1 @@ -59,6 +59,35 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +VMGROUPINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareworkloadnetworkvmgroup #> @@ -67,6 +96,7 @@ function Remove-AzVMwareWorkloadNetworkVMGroup { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityVMGroup', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # Name of the private cloud @@ -100,12 +130,20 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityVMGroup', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for VMGROUPINPUTOBJECT properties and create a hash table. + ${VMGroupInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -177,8 +215,9 @@ begin { $mapping = @{ Delete = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkVMGroup_Delete'; DeleteViaIdentity = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkVMGroup_DeleteViaIdentity'; + DeleteViaIdentityVMGroup = 'Az.VMware.private\Remove-AzVMwareWorkloadNetworkVMGroup_DeleteViaIdentityVMGroup'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDhcp.ps1 b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDhcp.ps1 index 9892ca981d95..fae5f0d32b03 100644 --- a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDhcp.ps1 +++ b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDhcp.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update dhcp by id in a private cloud workload network. +Update dhcp by id in a private cloud workload network. .Description -Create or update dhcp by id in a private cloud workload network. +Update dhcp by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Create or update dhcp by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkdhcp #> function Update-AzVMwareWorkloadNetworkDhcp { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDhcp])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDhcp])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DHCP identifier. @@ -100,10 +130,17 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("SERVER", "RELAY")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DhcpTypeEnum] + [System.String] # Type of DHCP: SERVER or RELAY. ${DhcpType}, @@ -124,7 +161,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -190,8 +228,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDhcp_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDhcp_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDhcp_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsService.ps1 b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsService.ps1 index d0c29f3d7bb7..73b654a414f0 100644 --- a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsService.ps1 +++ b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsService.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a DNS service by id in a private cloud workload network. +Update a DNS service by id in a private cloud workload network. .Description -Create or update a DNS service by id in a private cloud workload network. +Update a DNS service by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Create or update a DNS service by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkdnsservice #> function Update-AzVMwareWorkloadNetworkDnsService { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsService])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsService])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Service identifier. @@ -100,6 +130,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -126,9 +163,9 @@ param( ${FqdnZone}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("DEBUG", "INFO", "WARNING", "ERROR", "FATAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.DnsServiceLogLevelEnum] + [System.String] # DNS Service log level. ${LogLevel}, @@ -143,7 +180,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -209,8 +247,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsService_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsService_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsService_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsZone.ps1 b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsZone.ps1 index 6e69506680be..3b31db9bdc31 100644 --- a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsZone.ps1 +++ b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkDnsZone.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a DNS zone by id in a private cloud workload network. +Update a DNS zone by id in a private cloud workload network. .Description -Create or update a DNS zone by id in a private cloud workload network. +Update a DNS zone by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Create or update a DNS zone by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkdnszone #> function Update-AzVMwareWorkloadNetworkDnsZone { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkDnsZone])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkDnsZone])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX DNS Zone identifier. @@ -100,6 +130,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -143,7 +180,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -209,8 +247,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsZone_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkDnsZone_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkPortMirroring.ps1 b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkPortMirroring.ps1 index 2d7da83c4f67..9180d7a6488b 100644 --- a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkPortMirroring.ps1 +++ b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkPortMirroring.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a port mirroring profile by id in a private cloud workload network. +Update a port mirroring profile by id in a private cloud workload network. .Description -Create or update a port mirroring profile by id in a private cloud workload network. +Update a port mirroring profile by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Create or update a port mirroring profile by id in a private cloud workload netw .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring .Notes COMPLEX PARAMETER PROPERTIES @@ -59,14 +59,44 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkportmirroring #> function Update-AzVMwareWorkloadNetworkPortMirroring { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkPortMirroring])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkPortMirroring])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Port Mirroring identifier. @@ -100,6 +130,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -107,9 +144,9 @@ param( ${Destination}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum])] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.PSArgumentCompleterAttribute("INGRESS", "EGRESS", "BIDIRECTIONAL")] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PortMirroringDirectionEnum] + [System.String] # Direction of port mirroring profile. ${Direction}, @@ -136,7 +173,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -202,8 +240,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkPortMirroring_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkPortMirroring_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkSegment.ps1 b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkSegment.ps1 index af6308b267d4..6767c9e482e7 100644 --- a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkSegment.ps1 +++ b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkSegment.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a segment by id in a private cloud workload network. +Update a segment by id in a private cloud workload network. .Description -Create or update a segment by id in a private cloud workload network. +Update a segment by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Create or update a segment by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworksegment #> function Update-AzVMwareWorkloadNetworkSegment { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkSegment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkSegment])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -80,6 +109,7 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX Segment identifier. @@ -100,6 +130,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -136,7 +173,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -202,8 +240,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkSegment_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkSegment_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkSegment_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkVMGroup.ps1 b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkVMGroup.ps1 index 1e381916c980..427be40f9a13 100644 --- a/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkVMGroup.ps1 +++ b/src/VMware/VMware.Autorest/internal/Update-AzVMwareWorkloadNetworkVMGroup.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create or update a vm group by id in a private cloud workload network. +Update a vm group by id in a private cloud workload network. .Description -Create or update a vm group by id in a private cloud workload network. +Update a vm group by id in a private cloud workload network. .Example {{ Add code here }} .Example @@ -27,7 +27,7 @@ Create or update a vm group by id in a private cloud workload network. .Inputs Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup +Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup .Notes COMPLEX PARAMETER PROPERTIES @@ -59,11 +59,40 @@ INPUTOBJECT : Identity Parameter [SubscriptionId ]: The ID of the target subscription. [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT : Identity Parameter + [AddonName ]: Name of the addon for the private cloud + [AuthorizationName ]: Name of the ExpressRoute Circuit Authorization in the private cloud + [CloudLinkName ]: Name of the cloud link resource + [ClusterName ]: Name of the cluster in the private cloud + [DatastoreName ]: Name of the datastore in the private cloud cluster + [DhcpId ]: NSX DHCP identifier. Generally the same as the DHCP display name + [DnsServiceId ]: NSX DNS Service identifier. Generally the same as the DNS Service's display name + [DnsZoneId ]: NSX DNS Zone identifier. Generally the same as the DNS Zone's display name + [GatewayId ]: NSX Gateway identifier. Generally the same as the Gateway's display name + [GlobalReachConnectionName ]: Name of the global reach connection in the private cloud + [HcxEnterpriseSiteName ]: Name of the HCX Enterprise Site in the private cloud + [Id ]: Resource identity path + [Location ]: Azure region + [PlacementPolicyName ]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + [PortMirroringId ]: NSX Port Mirroring identifier. Generally the same as the Port Mirroring display name + [PrivateCloudName ]: Name of the private cloud + [PublicIPId ]: NSX Public IP Block identifier. Generally the same as the Public IP Block's display name + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [ScriptCmdletName ]: Name of the script cmdlet resource in the script package in the private cloud + [ScriptExecutionName ]: Name of the user-invoked script execution resource + [ScriptPackageName ]: Name of the script package in the private cloud + [SegmentId ]: NSX Segment identifier. Generally the same as the Segment's display name + [SubscriptionId ]: The ID of the target subscription. + [VMGroupId ]: NSX VM Group identifier. Generally the same as the VM Group's display name + [VirtualMachineId ]: Virtual Machine identifier + [WorkloadNetworkName ]: Name for the workload network in the private cloud .Link https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareworkloadnetworkvmgroup #> function Update-AzVMwareWorkloadNetworkVMGroup { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IWorkloadNetworkVMGroup])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IWorkloadNetworkVMGroup])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -87,6 +116,7 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] [System.String] # NSX VM Group identifier. @@ -100,6 +130,13 @@ param( # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityPrivateCloudExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity] + # Identity Parameter + # To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + ${PrivateCloudInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Body')] [System.String] @@ -124,7 +161,8 @@ param( [ValidateNotNull()] [Microsoft.Azure.PowerShell.Cmdlets.VMware.Category('Azure')] [System.Management.Automation.PSObject] - # The credentials, account, tenant, and subscription used for communication with Azure. + # The DefaultProfile parameter is not functional. + # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, [Parameter()] @@ -190,8 +228,9 @@ begin { $mapping = @{ UpdateExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkVMGroup_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityExpanded'; + UpdateViaIdentityPrivateCloudExpanded = 'Az.VMware.private\Update-AzVMwareWorkloadNetworkVMGroup_UpdateViaIdentityPrivateCloudExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id } diff --git a/src/VMware/VMware.Autorest/run-module.ps1 b/src/VMware/VMware.Autorest/run-module.ps1 index 73207b56c772..5f5b4ae33043 100644 --- a/src/VMware/VMware.Autorest/run-module.ps1 +++ b/src/VMware/VMware.Autorest/run-module.ps1 @@ -12,19 +12,19 @@ # 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]$Code) +param([switch]$NotIsolated, [switch]$Code) $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 } $isAzure = $true if($isAzure) { - . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts # Load the latest version of Az.Accounts installed Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version } diff --git a/src/VMware/VMware.Autorest/test-module.ps1 b/src/VMware/VMware.Autorest/test-module.ps1 index d612b51e0be5..694eaf2eb678 100644 --- a/src/VMware/VMware.Autorest/test-module.ps1 +++ b/src/VMware/VMware.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) @@ -91,4 +91,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/src/VMware/VMware.Autorest/test/AzVMwareAddon.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareAddon.Recording.json index ace22ec2c279..6e3d30fdf418 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareAddon.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareAddon.Recording.json @@ -1,8 +1,8 @@ { - "AzVMwareAddon+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/SRM?api-version=2021-12-01+1": { + "AzVMwareAddon+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/SRM?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/SRM?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/SRM?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"addonType\": \"SRM\",\r\n \"licenseKey\": \"YourLicenseKeyValue\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:09:53 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:00:50 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/SRM?api-version=2021-12-01+2": { + "AzVMwareAddon+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/SRM?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/SRM?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/SRM?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "2" ], - "x-ms-client-request-id": [ "6fe3c651-20bd-4072-a427-b03aab94bead" ], + "x-ms-client-request-id": [ "e945a9be-0ccb-4a46-b2c7-96c3875de8c9" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwareAddon" ], "FullCommandName": [ "New-AzVMwareAddon_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,31 +47,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:23 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:21 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/SRM?api-version=2021-12-01+3": { + "AzVMwareAddon+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/SRM?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/SRM?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/SRM?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "3" ], - "x-ms-client-request-id": [ "6fe3c651-20bd-4072-a427-b03aab94bead" ], + "x-ms-client-request-id": [ "e945a9be-0ccb-4a46-b2c7-96c3875de8c9" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwareAddon" ], "FullCommandName": [ "New-AzVMwareAddon_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -79,30 +79,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:23 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:21 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons?api-version=2021-12-01+4": { + "AzVMwareAddon+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons?api-version=2023-03-01+4": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "4" ], - "x-ms-client-request-id": [ "82c586b0-f1aa-454c-bfb4-d10206d415b2" ], + "x-ms-client-request-id": [ "8e2cee77-8838-4c22-a58d-b12038072280" ], "CommandName": [ "Az.VMware.internal\\Get-AzVMwareAddon" ], "FullCommandName": [ "Get-AzVMwareAddon_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -111,30 +111,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:23 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:21 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "253" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "324" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}]}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/vr?api-version=2021-12-01+1": { + "AzVMwareAddon+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/vr?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/addons/vr?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/addons/vr?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "5" ], - "x-ms-client-request-id": [ "7c956c9b-7aa9-4019-afc5-b68b1c541e44" ], + "x-ms-client-request-id": [ "c30ed3ac-951b-41b5-8524-d84c3c7a3c64" ], "CommandName": [ "Az.VMware.internal\\Get-AzVMwareAddon" ], "FullCommandName": [ "Get-AzVMwareAddon_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -143,21 +143,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:24 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:21 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/SRM?api-version=2021-12-01+1": { + "AzVMwareAddon+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/SRM?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/SRM?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/SRM?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"addonType\": \"SRM\",\r\n \"licenseKey\": \"YourLicenseKeyValue\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -170,31 +170,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:24 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:21 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/SRM?api-version=2021-12-01+2": { + "AzVMwareAddon+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/SRM?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/SRM?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/SRM?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "7" ], - "x-ms-client-request-id": [ "1dada9f4-452f-4285-84dd-325b6fbfaaf9" ], + "x-ms-client-request-id": [ "cda76a16-d27f-498a-b991-b320d3046ba1" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwareAddon" ], "FullCommandName": [ "New-AzVMwareAddon_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -202,31 +202,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:55 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:51 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/SRM?api-version=2021-12-01+3": { + "AzVMwareAddon+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/SRM?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/SRM?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/SRM?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "8" ], - "x-ms-client-request-id": [ "1dada9f4-452f-4285-84dd-325b6fbfaaf9" ], + "x-ms-client-request-id": [ "cda76a16-d27f-498a-b991-b320d3046ba1" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwareAddon" ], "FullCommandName": [ "New-AzVMwareAddon_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -234,30 +234,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:55 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:51 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "241" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "312" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm\",\"name\":\"srm\",\"type\":\"Microsoft.AVS/privateClouds/addons\",\"properties\":{\"addonType\":\"SRM\",\"provisioningState\":\"Succeeded\",\"licenseKey\":\"41915178-A8FF-4A4D-B683-6D735AF5E3F5\"}}", "isContentBase64": false } }, - "AzVMwareAddon+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/vr?api-version=2021-12-01+1": { + "AzVMwareAddon+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/vr?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/addons/vr?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/addons/vr?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "9" ], - "x-ms-client-request-id": [ "fb0256da-5b01-4a6c-b9ef-42bda63501b7" ], + "x-ms-client-request-id": [ "1fc92227-f3c0-472d-adf9-b16d5b2c639a" ], "CommandName": [ "Az.VMware.internal\\Remove-AzVMwareAddon" ], "FullCommandName": [ "Remove-AzVMwareAddon_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -266,8 +266,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:56 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:51 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Recording.json index df463cee456d..539372e036cb 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Recording.json @@ -1,8 +1,8 @@ { - "AzVMwareAuthorization+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01+1": { + "AzVMwareAuthorization+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01", "Content": "{\r\n}", "isContentBase64": false, "Headers": { @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:10:58 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:01:52 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01+2": { + "AzVMwareAuthorization+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "11" ], - "x-ms-client-request-id": [ "d016e5b0-7e68-416f-937a-5e68071383cc" ], + "x-ms-client-request-id": [ "17cc8c6b-a606-479b-9ab0-640b401c7d8b" ], "CommandName": [ "New-AzVMwareAuthorization" ], "FullCommandName": [ "New-AzVMwareAuthorization_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,31 +47,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:11:28 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:23 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01+3": { + "AzVMwareAuthorization+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "12" ], - "x-ms-client-request-id": [ "d016e5b0-7e68-416f-937a-5e68071383cc" ], + "x-ms-client-request-id": [ "17cc8c6b-a606-479b-9ab0-640b401c7d8b" ], "CommandName": [ "New-AzVMwareAuthorization" ], "FullCommandName": [ "New-AzVMwareAuthorization_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -79,30 +79,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:11:28 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:23 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations?api-version=2021-12-01+4": { + "AzVMwareAuthorization+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations?api-version=2023-03-01+4": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "13" ], - "x-ms-client-request-id": [ "fe0e5280-7860-4c30-be6b-2ae3e9f995d3" ], + "x-ms-client-request-id": [ "24fc2b5d-3fdf-4ea4-9c62-31a5dc2cf40a" ], "CommandName": [ "Get-AzVMwareAuthorization" ], "FullCommandName": [ "Get-AzVMwareAuthorization_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -111,30 +111,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:11:28 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:23 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "803" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "841" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}]}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01+1": { + "AzVMwareAuthorization+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/authorization1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "14" ], - "x-ms-client-request-id": [ "8446e484-8f30-460d-a18b-89f5efb000d8" ], + "x-ms-client-request-id": [ "32256120-169f-404a-8de2-88b6018814b9" ], "CommandName": [ "Get-AzVMwareAuthorization" ], "FullCommandName": [ "Get-AzVMwareAuthorization_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -143,21 +143,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:11:30 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:23 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog/authorizations/5q2kvd?api-version=2021-12-01+1": { + "AzVMwareAuthorization+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1/authorizations/authorization1?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog/authorizations/5q2kvd?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1/authorizations/authorization1?api-version=2023-03-01", "Content": "{\r\n}", "isContentBase64": false, "Headers": { @@ -170,31 +170,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:11:30 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:23 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog/authorizations/5q2kvd?api-version=2021-12-01+2": { + "AzVMwareAuthorization+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1/authorizations/authorization1?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog/authorizations/5q2kvd?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1/authorizations/authorization1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "16" ], - "x-ms-client-request-id": [ "43d9d293-89c7-4679-9aa8-3fe3bfb8595c" ], + "x-ms-client-request-id": [ "e64e184b-e247-4732-b001-222da1b5f373" ], "CommandName": [ "New-AzVMwareAuthorization" ], "FullCommandName": [ "New-AzVMwareAuthorization_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -202,31 +202,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:00 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:53 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog/authorizations/5q2kvd?api-version=2021-12-01+3": { + "AzVMwareAuthorization+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1/authorizations/authorization1?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog/authorizations/5q2kvd?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1/authorizations/authorization1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "17" ], - "x-ms-client-request-id": [ "43d9d293-89c7-4679-9aa8-3fe3bfb8595c" ], + "x-ms-client-request-id": [ "e64e184b-e247-4732-b001-222da1b5f373" ], "CommandName": [ "New-AzVMwareAuthorization" ], "FullCommandName": [ "New-AzVMwareAuthorization_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -234,30 +234,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:00 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:53 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareAuthorization+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01+1": { + "AzVMwareAuthorization+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/2hlsk5?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/2hlsk5?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "18" ], - "x-ms-client-request-id": [ "29cfb66c-67f9-44b2-81f6-a895a0621340" ], + "x-ms-client-request-id": [ "5a53dd0a-5fb8-4a34-ad70-8f789ad7ee2a" ], "CommandName": [ "Remove-AzVMwareAuthorization" ], "FullCommandName": [ "Remove-AzVMwareAuthorization_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -266,8 +266,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:01 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:53 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Tests.ps1 b/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Tests.ps1 index b0e5d139f7e0..7a6d4b7d507b 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Tests.ps1 +++ b/src/VMware/VMware.Autorest/test/AzVMwareAuthorization.Tests.ps1 @@ -14,7 +14,7 @@ while(-not $mockingPath) { Describe 'AzVMwareAuthorization' { It 'List' { { - $config = New-AzVMwareAuthorization -Name $env.rstr3 -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 + $config = New-AzVMwareAuthorization -Name "authorization1" -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 $config.Name | Should -Be "authorization1" $config = Get-AzVMwareAuthorization -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 @@ -24,14 +24,14 @@ Describe 'AzVMwareAuthorization' { It 'Get' { { - $config = Get-AzVMwareAuthorization -Name $env.rstr3 -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 + $config = Get-AzVMwareAuthorization -Name "authorization1" -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 $config.Name | Should -Be "authorization1" } | Should -Not -Throw } It 'CreateExpanded' { { - $config = New-AzVMwareAuthorization -Name $env.rstr4 -PrivateCloudName $env.privateCloudName3 -ResourceGroupName $env.resourceGroup3 + $config = New-AzVMwareAuthorization -Name "authorization1" -PrivateCloudName $env.privateCloudName3 -ResourceGroupName $env.resourceGroup3 $config.Name | Should -Be "authorization1" } | Should -Not -Throw } diff --git a/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Recording.json index 614b4cc05641..0c9808560af8 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Recording.json @@ -1,9 +1,9 @@ { - "AzVMwareCloudLink+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01+1": { + "AzVMwareCloudLink+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/cloudLink1?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01", - "Content": "{\r\n \"properties\": {\r\n \"linkedCloud\": \"/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/cloudLink1?api-version=2023-03-01", + "Content": "{\r\n \"properties\": {\r\n \"linkedCloud\": \"/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:01 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:02:53 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "367" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "386" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", "isContentBase64": false } }, - "AzVMwareCloudLink+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01+2": { + "AzVMwareCloudLink+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/cloudLink1?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/cloudLink1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "20" ], - "x-ms-client-request-id": [ "4ca7c8de-ab29-4d09-8f43-af4669a11610" ], + "x-ms-client-request-id": [ "0925e6f9-bd79-48a0-ad19-54f1d5a2c77c" ], "CommandName": [ "New-AzVMwareCloudLink" ], "FullCommandName": [ "New-AzVMwareCloudLink_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,30 +47,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:32 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:24 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "367" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "386" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", "isContentBase64": false } }, - "AzVMwareCloudLink+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks?api-version=2021-12-01+3": { + "AzVMwareCloudLink+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "21" ], - "x-ms-client-request-id": [ "a2247a48-2c00-461b-97b6-c957df5ab0e4" ], + "x-ms-client-request-id": [ "01d54536-2324-4643-9d27-335b4ddb345f" ], "CommandName": [ "Get-AzVMwareCloudLink" ], "FullCommandName": [ "Get-AzVMwareCloudLink_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -79,30 +79,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:32 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:24 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "379" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "398" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}]}", "isContentBase64": false } }, - "AzVMwareCloudLink+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01+1": { + "AzVMwareCloudLink+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/cloudLink1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/cloudLink1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "22" ], - "x-ms-client-request-id": [ "a1893c83-8109-4f72-8497-3413a257aaab" ], + "x-ms-client-request-id": [ "8e4a6d5c-9340-4529-9976-257d3503469a" ], "CommandName": [ "Get-AzVMwareCloudLink" ], "FullCommandName": [ "Get-AzVMwareCloudLink_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -111,22 +111,22 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:33 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:24 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "367" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "386" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", "isContentBase64": false } }, - "AzVMwareCloudLink+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01+1": { + "AzVMwareCloudLink+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/2hlsk5?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01", - "Content": "{\r\n \"properties\": {\r\n \"linkedCloud\": \"/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/2hlsk5?api-version=2023-03-01", + "Content": "{\r\n \"properties\": {\r\n \"linkedCloud\": \"/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, @@ -138,31 +138,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:12:33 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:24 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "367" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "386" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", "isContentBase64": false } }, - "AzVMwareCloudLink+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01+2": { + "AzVMwareCloudLink+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/2hlsk5?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/2hlsk5?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "24" ], - "x-ms-client-request-id": [ "0f1cbd55-ee10-46c0-abad-b52641013c87" ], + "x-ms-client-request-id": [ "84f8b3c7-31cb-42e5-96da-1ae658aadcc9" ], "CommandName": [ "New-AzVMwareCloudLink" ], "FullCommandName": [ "New-AzVMwareCloudLink_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -170,30 +170,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:05 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:54 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "367" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "386" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/cloudLinks/cloudLink1\",\"name\":\"cloudLink1\",\"type\":\"Microsoft.AVS/privateClouds/cloudLinks\",\"properties\":{\"status\":\"Active\",\"linkedCloud\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"}}", "isContentBase64": false } }, - "AzVMwareCloudLink+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01+1": { + "AzVMwareCloudLink+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/2hlsk5?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/cloudLinks/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/cloudLinks/2hlsk5?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "25" ], - "x-ms-client-request-id": [ "b994f9e6-9e6b-41fe-9227-fd5de9c94c09" ], + "x-ms-client-request-id": [ "e8e99875-25e1-485b-a581-75682700d9d2" ], "CommandName": [ "Remove-AzVMwareCloudLink" ], "FullCommandName": [ "Remove-AzVMwareCloudLink_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -202,8 +202,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:05 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:54 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Tests.ps1 b/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Tests.ps1 index b0bac8898bad..d1d1fb89438c 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Tests.ps1 +++ b/src/VMware/VMware.Autorest/test/AzVMwareCloudLink.Tests.ps1 @@ -15,7 +15,7 @@ Describe 'AzVMwareCloudLink' { It 'List' { { $Id2 = "/subscriptions/$($env.SubscriptionId)/resourceGroups/$($env.resourceGroup2)/providers/Microsoft.AVS/privateClouds/$($env.privateCloudName2)" - $config = New-AzVMwareCloudLink -Name $env.rstr3 -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 -LinkedCloud $Id2 + $config = New-AzVMwareCloudLink -Name "cloudLink1" -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 -LinkedCloud $Id2 $config.Name | Should -Be "cloudLink1" $config = Get-AzVMwareCloudLink -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 @@ -25,7 +25,7 @@ Describe 'AzVMwareCloudLink' { It 'Get' { { - $config = Get-AzVMwareCloudLink -Name $env.rstr3 -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 + $config = Get-AzVMwareCloudLink -Name "cloudLink1" -PrivateCloudName $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 $config.Name | Should -Be "cloudLink1" } | Should -Not -Throw } diff --git a/src/VMware/VMware.Autorest/test/AzVMwareCluster.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareCluster.Recording.json index d1ad485e830e..62b461cdea28 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareCluster.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareCluster.Recording.json @@ -1,8 +1,8 @@ { - "AzVMwareCluster+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+1": { + "AzVMwareCluster+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": "{\r\n \"sku\": {\r\n \"name\": \"av20\"\r\n },\r\n \"properties\": {\r\n \"clusterSize\": 3\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:06 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:03:54 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "393" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "412" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+2": { + "AzVMwareCluster+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "27" ], - "x-ms-client-request-id": [ "224fbde4-61c3-4d77-8d3f-46c3d0b020b5" ], + "x-ms-client-request-id": [ "8d7c5088-8204-49c9-8b22-44b6b23508ae" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,31 +47,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:36 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:25 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+3": { + "AzVMwareCluster+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "28" ], - "x-ms-client-request-id": [ "224fbde4-61c3-4d77-8d3f-46c3d0b020b5" ], + "x-ms-client-request-id": [ "8d7c5088-8204-49c9-8b22-44b6b23508ae" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -79,30 +79,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:36 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:25 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters?api-version=2021-12-01+4": { + "AzVMwareCluster+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters?api-version=2023-03-01+4": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "29" ], - "x-ms-client-request-id": [ "a6f958d7-65b9-4657-a9bc-de89d12bcaf9" ], + "x-ms-client-request-id": [ "2592af76-c9ae-4d48-aa62-f391c39a08d2" ], "CommandName": [ "Get-AzVMwareCluster" ], "FullCommandName": [ "Get-AzVMwareCluster_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -111,30 +111,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:36 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:25 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "405" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "424" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}]}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+1": { + "AzVMwareCluster+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "30" ], - "x-ms-client-request-id": [ "386fa8ea-ba24-4c9d-b76a-54c56aa59732" ], + "x-ms-client-request-id": [ "7f9099d7-4ce9-4b9c-b54d-70a73739b3c9" ], "CommandName": [ "Get-AzVMwareCluster" ], "FullCommandName": [ "Get-AzVMwareCluster_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -143,21 +143,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:38 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:25 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+1": { + "AzVMwareCluster+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": "{\r\n \"sku\": {\r\n \"name\": \"av36\"\r\n },\r\n \"properties\": {\r\n \"clusterSize\": 3\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -170,31 +170,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:13:38 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:25 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "393" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "412" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+2": { + "AzVMwareCluster+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "32" ], - "x-ms-client-request-id": [ "676c1c2b-e7c1-43ef-958a-8507571918c2" ], + "x-ms-client-request-id": [ "6629dc9e-b467-4f91-9680-f71a15413c80" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -202,31 +202,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:08 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:56 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+3": { + "AzVMwareCluster+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "33" ], - "x-ms-client-request-id": [ "676c1c2b-e7c1-43ef-958a-8507571918c2" ], + "x-ms-client-request-id": [ "6629dc9e-b467-4f91-9680-f71a15413c80" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -234,21 +234,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:08 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:56 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+UpdateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+1": { + "AzVMwareCluster+[NoContext]+UpdateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": "{\r\n \"sku\": {\r\n \"name\": \"av36\"\r\n },\r\n \"properties\": {\r\n \"clusterSize\": 3\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -261,31 +261,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:08 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:04:56 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "393" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "412" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+2": { + "AzVMwareCluster+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "35" ], - "x-ms-client-request-id": [ "4a05d5f4-9c68-4e46-86fb-fc23a6088693" ], + "x-ms-client-request-id": [ "1b45113c-f0e1-473e-9869-d7cc5344de2a" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -293,31 +293,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:39 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:26 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+3": { + "AzVMwareCluster+[NoContext]+UpdateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "36" ], - "x-ms-client-request-id": [ "4a05d5f4-9c68-4e46-86fb-fc23a6088693" ], + "x-ms-client-request-id": [ "1b45113c-f0e1-473e-9869-d7cc5344de2a" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -325,21 +325,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:39 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:26 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+4": { + "AzVMwareCluster+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+4": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"clusterSize\": 4\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -352,30 +352,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:39 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:26 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+UpdateExpanded+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+5": { + "AzVMwareCluster+[NoContext]+UpdateExpanded+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+5": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "38" ], - "x-ms-client-request-id": [ "671bae33-bddb-4b6b-8825-bd499a1491e4" ], + "x-ms-client-request-id": [ "bf45bfc1-d0b3-46d9-89aa-2c5469bf5ce1" ], "CommandName": [ "Remove-AzVMwareCluster" ], "FullCommandName": [ "Remove-AzVMwareCluster_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -384,8 +384,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:41 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:26 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] @@ -394,19 +394,19 @@ "isContentBase64": false } }, - "AzVMwareCluster+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01+1": { + "AzVMwareCluster+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz/clusters/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel/clusters/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "39" ], - "x-ms-client-request-id": [ "33bb3e60-104f-4581-9266-c1c1993287bb" ], + "x-ms-client-request-id": [ "8bbd6d32-3dbf-4bde-a562-cdb8e9e84912" ], "CommandName": [ "Remove-AzVMwareCluster" ], "FullCommandName": [ "Remove-AzVMwareCluster_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -415,8 +415,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:41 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:26 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareDatastore.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareDatastore.Recording.json index 65018594791e..675c4f801c4d 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareDatastore.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareDatastore.Recording.json @@ -1,8 +1,8 @@ { - "Get-AzVMwareDatastore+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01+1": { + "Get-AzVMwareDatastore+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"netAppVolume\": {\r\n \"id\": \"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"\r\n }\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:14:42 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:26 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "501" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "520" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01+2": { + "Get-AzVMwareDatastore+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "41" ], - "x-ms-client-request-id": [ "d1bd5a8f-feae-4688-940b-f6d102f96367" ], + "x-ms-client-request-id": [ "47b70b4f-cdd0-40c3-a601-ed1870277ffd" ], "CommandName": [ "New-AzVMwareDatastore" ], "FullCommandName": [ "New-AzVMwareDatastore_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,31 +47,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:12 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "501" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "520" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01+3": { + "Get-AzVMwareDatastore+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "42" ], - "x-ms-client-request-id": [ "d1bd5a8f-feae-4688-940b-f6d102f96367" ], + "x-ms-client-request-id": [ "47b70b4f-cdd0-40c3-a601-ed1870277ffd" ], "CommandName": [ "New-AzVMwareDatastore" ], "FullCommandName": [ "New-AzVMwareDatastore_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -79,30 +79,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:12 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "501" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "520" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01+1": { + "Get-AzVMwareDatastore+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "43" ], - "x-ms-client-request-id": [ "487a3f69-e4f2-4048-8807-4997ed2166fb" ], + "x-ms-client-request-id": [ "d73b6f0c-4798-4ad6-861b-dde572262a70" ], "CommandName": [ "Get-AzVMwareDatastore" ], "FullCommandName": [ "Get-AzVMwareDatastore_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -111,30 +111,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:12 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "501" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "520" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores?api-version=2021-12-01+1": { + "Get-AzVMwareDatastore+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "44" ], - "x-ms-client-request-id": [ "1af6405a-5510-4263-9261-2351d4c0a550" ], + "x-ms-client-request-id": [ "c751ca2a-0732-486a-9a3d-0c0d14ec7060" ], "CommandName": [ "Get-AzVMwareDatastore" ], "FullCommandName": [ "Get-AzVMwareDatastore_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -143,30 +143,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:13 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1095" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1133" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}},{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore2\",\"name\":\"datastore2\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"diskPoolVolume\":{\"targetId\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.StoragePool/diskPools/DiskPool1/targets/Target1\",\"lunName\":\"lun0\",\"mountOption\":\"MOUNT\",\"path\":\"/vmfs/devices/disks/naa.6001405f75f6bdf7f6f49db8b4b21723\"},\"status\":\"Accessible\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore2\",\"name\":\"datastore2\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"diskPoolVolume\":{\"targetId\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.StoragePool/diskPools/DiskPool1/targets/Target1\",\"lunName\":\"lun0\",\"mountOption\":\"MOUNT\",\"path\":\"/vmfs/devices/disks/naa.6001405f75f6bdf7f6f49db8b4b21723\"},\"status\":\"Accessible\"}}]}", "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01+1": { + "Get-AzVMwareDatastore+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "45" ], - "x-ms-client-request-id": [ "19763250-f634-4ee8-9359-1a1849cb2648" ], + "x-ms-client-request-id": [ "2d474737-a0e9-48ed-ae6e-055808ea01f8" ], "CommandName": [ "Remove-AzVMwareDatastore" ], "FullCommandName": [ "Remove-AzVMwareDatastore_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -175,8 +175,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:13 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] @@ -185,19 +185,19 @@ "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01+1": { + "Get-AzVMwareDatastore+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/datastores/datastore1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "46" ], - "x-ms-client-request-id": [ "225ba3a4-902b-4443-9479-ba1c14d237b2" ], + "x-ms-client-request-id": [ "bcb83b2f-bf3c-4e9d-9f9c-9bbe68a860b6" ], "CommandName": [ "Get-AzVMwareDatastore" ], "FullCommandName": [ "Get-AzVMwareDatastore_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -206,30 +206,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:14 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "501" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "520" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1\",\"name\":\"datastore1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/datastores\",\"properties\":{\"provisioningState\":\"Succeeded\",\"netAppVolume\":{\"id\":\"/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/ResourceGroup1/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1\"},\"status\":\"Accessible\"}}", "isContentBase64": false } }, - "Get-AzVMwareDatastore+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1?api-version=2021-12-01+2": { + "Get-AzVMwareDatastore+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1?api-version=2023-03-01+2": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/%7Bsubscription-id%7D/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/datastores/datastore1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "47" ], - "x-ms-client-request-id": [ "793c9c4d-29d3-45c5-a128-80ab3f813993" ], + "x-ms-client-request-id": [ "cfb4fbe3-47c1-4d05-9f59-1110ca2d0363" ], "CommandName": [ "Remove-AzVMwareDatastore" ], "FullCommandName": [ "Remove-AzVMwareDatastore_DeleteViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -238,8 +238,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:14 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareGlobalReachConnection.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareGlobalReachConnection.Recording.json index c3999ec3bee6..de4883f38023 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareGlobalReachConnection.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareGlobalReachConnection.Recording.json @@ -1,17 +1,17 @@ { - "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/xdn238?api-version=2021-12-01+1": { + "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "48" ], - "x-ms-client-request-id": [ "a73965e8-e880-46d5-ab35-9f6f3e18bb0b" ], + "x-ms-client-request-id": [ "e4ababf3-4db7-4302-90c9-c67321623764" ], "CommandName": [ "Get-AzVMwareAuthorization" ], "FullCommandName": [ "Get-AzVMwareAuthorization_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -20,30 +20,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:16 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog?api-version=2021-12-01+2": { + "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "49" ], - "x-ms-client-request-id": [ "bf8053b3-cf8b-4550-ba7e-828819db42ca" ], + "x-ms-client-request-id": [ "8274daff-d60c-4e0d-bb85-c036c5f82e62" ], "CommandName": [ "Get-AzVMwarePrivateCloud" ], "FullCommandName": [ "Get-AzVMwarePrivateCloud_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -52,58 +52,58 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:16 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01+3": { + "AzVMwareGlobalReachConnection+[NoContext]+List+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01+3": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01", - "Content": "{\r\n \"properties\": {\r\n \"authorizationKey\": \"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\r\n \"peerExpressRouteCircuit\": \"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01", + "Content": "{\r\n \"properties\": {\r\n \"authorizationKey\": \"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\r\n \"peerExpressRouteCircuit\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, "ContentHeaders": { "Content-Type": [ "application/json" ], - "Content-Length": [ "335" ] + "Content-Length": [ "354" ] } }, "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:17 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:05:57 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01+4": { + "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01+4": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "51" ], - "x-ms-client-request-id": [ "55780377-0982-4812-b311-3a926723f0ee" ], + "x-ms-client-request-id": [ "16f191c5-c320-4352-be13-4674deeea56a" ], "CommandName": [ "New-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "New-AzVMwareGlobalReachConnection_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -111,31 +111,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:47 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01+5": { + "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01+5": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "52" ], - "x-ms-client-request-id": [ "55780377-0982-4812-b311-3a926723f0ee" ], + "x-ms-client-request-id": [ "16f191c5-c320-4352-be13-4674deeea56a" ], "CommandName": [ "New-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "New-AzVMwareGlobalReachConnection_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -143,30 +143,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:47 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections?api-version=2021-12-01+6": { + "AzVMwareGlobalReachConnection+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections?api-version=2023-03-01+6": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "53" ], - "x-ms-client-request-id": [ "b1864550-2486-4168-8fb8-2c58c798e8bb" ], + "x-ms-client-request-id": [ "48b67ca0-a4fe-40a5-9371-c711f3258bfa" ], "CommandName": [ "Get-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "Get-AzVMwareGlobalReachConnection_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -175,30 +175,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:47 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "796" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "834" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}]}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01+1": { + "AzVMwareGlobalReachConnection+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/yrles9?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/2hlsk5?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "54" ], - "x-ms-client-request-id": [ "b4f146d2-f1dc-4981-95bb-45224a34674a" ], + "x-ms-client-request-id": [ "b534416b-d9c9-4283-924f-54345f521042" ], "CommandName": [ "Get-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "Get-AzVMwareGlobalReachConnection_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -207,30 +207,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:48 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/xdn238?api-version=2021-12-01+1": { + "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/authorizations/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/authorizations/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "55" ], - "x-ms-client-request-id": [ "89ec44c1-4fa3-4fb5-ba5f-a973bcb57eba" ], + "x-ms-client-request-id": [ "55c36a7c-025c-4462-8be7-89d5222dea10" ], "CommandName": [ "Get-AzVMwareAuthorization" ], "FullCommandName": [ "Get-AzVMwareAuthorization_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -239,30 +239,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:48 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "791" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "829" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/authorizations/authorization1\",\"name\":\"authorization1\",\"type\":\"Microsoft.AVS/privateClouds/authorizations\",\"properties\":{\"provisioningState\":\"Succeeded\",\"expressRouteAuthorizationId\":\"/subscriptions/5206f269-120b-41ef-a95b-0dce7109de61/resourceGroups/tnt34-cust-mockp02-spearj2dev/providers/Microsoft.Network/expressroutecircuits/tnt34-cust-mockp02-spearj2dev-er/authorizations/myauth\",\"expressRouteAuthorizationKey\":\"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog?api-version=2021-12-01+2": { + "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudbeog?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudaoz1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "56" ], - "x-ms-client-request-id": [ "61397ebf-2a8d-4b18-8290-13c3e90b19bb" ], + "x-ms-client-request-id": [ "c4811e40-4814-41d0-b574-e0f5f3e15d65" ], "CommandName": [ "Get-AzVMwarePrivateCloud" ], "FullCommandName": [ "Get-AzVMwarePrivateCloud_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -271,58 +271,58 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:48 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01+3": { + "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01+3": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01", - "Content": "{\r\n \"properties\": {\r\n \"authorizationKey\": \"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\r\n \"peerExpressRouteCircuit\": \"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"\r\n }\r\n}", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01", + "Content": "{\r\n \"properties\": {\r\n \"authorizationKey\": \"37b0db3b-3b17-4c7b-bf76-bf13b01bcadc\",\r\n \"peerExpressRouteCircuit\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"\r\n }\r\n}", "isContentBase64": false, "Headers": { }, "ContentHeaders": { "Content-Type": [ "application/json" ], - "Content-Length": [ "335" ] + "Content-Length": [ "354" ] } }, "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:15:50 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:28 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01+4": { + "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01+4": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "58" ], - "x-ms-client-request-id": [ "1deaf9ff-fb3f-4049-abad-76b09922175a" ], + "x-ms-client-request-id": [ "46df967c-b7a5-4b5c-993c-e6badef79cb2" ], "CommandName": [ "New-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "New-AzVMwareGlobalReachConnection_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -330,31 +330,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:20 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:58 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01+5": { + "AzVMwareGlobalReachConnection+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01+5": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "59" ], - "x-ms-client-request-id": [ "1deaf9ff-fb3f-4049-abad-76b09922175a" ], + "x-ms-client-request-id": [ "46df967c-b7a5-4b5c-993c-e6badef79cb2" ], "CommandName": [ "New-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "New-AzVMwareGlobalReachConnection_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -362,30 +362,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:20 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:58 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "784" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "822" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/globalReachConnections/connection1\",\"name\":\"connection1\",\"type\":\"Microsoft.AVS/privateClouds/globalReachConnections\",\"properties\":{\"provisioningState\":\"Succeeded\",\"addressPrefix\":\"10.2.3.16/29\",\"authorizationKey\":\"01010101-0101-0101-0101-010101010101\",\"circuitConnectionStatus\":\"Connected\",\"peerExpressRouteCircuit\":\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.Network/expressRouteCircuits/mypeer\",\"expressRouteId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"}}", "isContentBase64": false } }, - "AzVMwareGlobalReachConnection+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01+1": { + "AzVMwareGlobalReachConnection+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/globalReachConnections/5q2kvd?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/globalReachConnections/p9uh7g?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "60" ], - "x-ms-client-request-id": [ "0202fedb-e96e-45ea-a2e7-d44f2a162558" ], + "x-ms-client-request-id": [ "05a1916b-7d85-4c78-83f2-062026c75ead" ], "CommandName": [ "Remove-AzVMwareGlobalReachConnection" ], "FullCommandName": [ "Remove-AzVMwareGlobalReachConnection_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -394,8 +394,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:20 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:58 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Recording.json index c2903459df5b..a3d1e6982663 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Recording.json @@ -1,17 +1,17 @@ { - "AzVMwareLocationQuotaAvailability+[NoContext]+Check+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/centralus/checkQuotaAvailability?api-version=2021-12-01+1": { + "AzVMwareLocationQuotaAvailability+[NoContext]+Check+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/westcentralus/checkQuotaAvailability?api-version=2023-03-01+1": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/centralus/checkQuotaAvailability?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/westcentralus/checkQuotaAvailability?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "61" ], - "x-ms-client-request-id": [ "53a0e0d7-e475-48d0-b750-582c054c4e42" ], + "x-ms-client-request-id": [ "a3613664-6224-4cbd-a144-192f660e69d7" ], "CommandName": [ "Test-AzVMwareLocationQuotaAvailability" ], "FullCommandName": [ "Test-AzVMwareLocationQuotaAvailability_Check" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -20,12 +20,12 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:21 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:58 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "65" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "65" ] }, "Content": "{\"hostsRemaining\":{\"AV20\":0,\"AV36\":999},\"quotaEnabled\":\"Enabled\"}", "isContentBase64": false diff --git a/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Tests.ps1 b/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Tests.ps1 index 9b969561dad0..374edd6153f5 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Tests.ps1 +++ b/src/VMware/VMware.Autorest/test/AzVMwareLocationQuotaAvailability.Tests.ps1 @@ -14,7 +14,7 @@ while(-not $mockingPath) { Describe 'AzVMwareLocationQuotaAvailability' { It 'Check' { { - $config = Test-AzVMwareLocationQuotaAvailability -Location $env.location1 + $config = Test-AzVMwareLocationQuotaAvailability -Location $env.location2 $config.Enabled | Should -Be "Enabled" } | Should -Not -Throw } diff --git a/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Recording.json index a030bd59ce05..8215fd6e319e 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Recording.json @@ -1,31 +1,26 @@ { - "AzVMwareLocationTrialAvailability+[NoContext]+Check+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/eastus2/checkTrialAvailability?api-version=2021-12-01+1": { + "AzVMwareLocationTrialAvailability+[NoContext]+Check+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/eastus2/checkTrialAvailability?api-version=2023-03-01+1": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/eastus2/checkTrialAvailability?api-version=2021-12-01", - "Content": null, + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/locations/eastus2/checkTrialAvailability?api-version=2023-03-01", + "Content": "{\r\n \"name\": \"av36\"\r\n}", "isContentBase64": false, "Headers": { - "x-ms-unique-id": [ "62" ], - "x-ms-client-request-id": [ "cea0dcf0-1095-44c2-a326-54e891078ae6" ], - "CommandName": [ "Test-AzVMwareLocationTrialAvailability" ], - "FullCommandName": [ "Test-AzVMwareLocationTrialAvailability_Check" ], - "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], - "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { + "Content-Type": [ "application/json" ], + "Content-Length": [ "22" ] } }, "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:21 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:06:58 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "46" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "46" ] }, "Content": "{\"status\":\"TrialAvailable\",\"availableHosts\":4}", "isContentBase64": false diff --git a/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Tests.ps1 b/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Tests.ps1 index b3af7c42a470..7c042cc9db4e 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Tests.ps1 +++ b/src/VMware/VMware.Autorest/test/AzVMwareLocationTrialAvailability.Tests.ps1 @@ -14,7 +14,7 @@ while(-not $mockingPath) { Describe 'AzVMwareLocationTrialAvailability' { It 'Check' { { - $config = Test-AzVMwareLocationTrialAvailability -Location "eastus2" + $config = Test-AzVMwareLocationTrialAvailability -Location "eastus2" -Name av36 $config.Status | Should -Be "TrialAvailable" } | Should -Not -Throw } diff --git a/src/VMware/VMware.Autorest/test/AzVMwarePlacementPolicy.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwarePlacementPolicy.Recording.json index ef6eb58cca45..494ab1073ade 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwarePlacementPolicy.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwarePlacementPolicy.Recording.json @@ -1,8 +1,8 @@ { - "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": "{\r\n \"sku\": {\r\n \"name\": \"av20\"\r\n },\r\n \"properties\": {\r\n \"clusterSize\": 3\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:23 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:07:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "393" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "412" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":3,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+2": { + "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "64" ], - "x-ms-client-request-id": [ "f08e9b9a-0586-47a6-86fc-a0ff21c6e241" ], + "x-ms-client-request-id": [ "a10637f5-ed25-4b87-baa2-152f68fae09c" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,31 +47,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:53 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:07:30 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01+3": { + "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "65" ], - "x-ms-client-request-id": [ "f08e9b9a-0586-47a6-86fc-a0ff21c6e241" ], + "x-ms-client-request-id": [ "a10637f5-ed25-4b87-baa2-152f68fae09c" ], "CommandName": [ "New-AzVMwareCluster" ], "FullCommandName": [ "New-AzVMwareCluster_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -79,21 +79,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:53 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:07:30 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "429" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "448" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1\",\"name\":\"cluster1\",\"type\":\"Microsoft.AVS/privateClouds/clusters\",\"sku\":{\"name\":\"AV20\"},\"properties\":{\"clusterSize\":4,\"provisioningState\":\"Succeeded\",\"hosts\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\",\"fakehost25.nyc1.kubernetes.center\"]}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+4": { + "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+4": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"type\": \"VmVm\",\r\n \"vmMembers\": [ \"System.Collections.Hashtable\" ],\r\n \"affinityType\": \"Affinity\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -106,31 +106,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:16:54 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:07:30 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "338" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "910" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+5": { + "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+5": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "67" ], - "x-ms-client-request-id": [ "35f193bd-679f-4976-b59e-7347f9b4ec71" ], + "x-ms-client-request-id": [ "a2d2259d-41f2-492e-9a6a-ce97d556552e" ], "CommandName": [ "New-AzVMwarePlacementPolicy" ], "FullCommandName": [ "New-AzVMwarePlacementPolicy_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -138,31 +138,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:24 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "338" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "910" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+6": { + "AzVMwarePlacementPolicy+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+6": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "68" ], - "x-ms-client-request-id": [ "35f193bd-679f-4976-b59e-7347f9b4ec71" ], + "x-ms-client-request-id": [ "a2d2259d-41f2-492e-9a6a-ce97d556552e" ], "CommandName": [ "New-AzVMwarePlacementPolicy" ], "FullCommandName": [ "New-AzVMwarePlacementPolicy_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -170,30 +170,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:24 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "338" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "910" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "69" ], - "x-ms-client-request-id": [ "49ad8d4e-90c8-4966-a51d-f42d07901006" ], + "x-ms-client-request-id": [ "99b76276-e58e-4925-ac57-427341ca2885" ], "CommandName": [ "Get-AzVMwarePlacementPolicy" ], "FullCommandName": [ "Get-AzVMwarePlacementPolicy_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -202,30 +202,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:24 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "687" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1642" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}},{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy2\",\"name\":\"policy2\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmVm\",\"state\":\"Enabled\",\"displayName\":\"policy2\",\"provisioningState\":\"Succeeded\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy2\",\"name\":\"policy2\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmVm\",\"state\":\"Enabled\",\"displayName\":\"policy2\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"affinityType\":\"Affinity\"}}]}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "70" ], - "x-ms-client-request-id": [ "e3ada5d5-4975-4227-9674-ad6e990b6058" ], + "x-ms-client-request-id": [ "a4193440-9289-4cc8-a154-f8ec8036c194" ], "CommandName": [ "Get-AzVMwarePlacementPolicy" ], "FullCommandName": [ "Get-AzVMwarePlacementPolicy_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -234,21 +234,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:26 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "338" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "910" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+1": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -261,30 +261,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:26 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "339" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "911" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Disabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Disabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+UpdateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+UpdateViaIdentityExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "72" ], - "x-ms-client-request-id": [ "c6f11bd3-dd33-42d0-8e96-d2be94defed2" ], + "x-ms-client-request-id": [ "8af6f826-57d4-4999-9aed-aadae8bef7cc" ], "CommandName": [ "Get-AzVMwarePlacementPolicy" ], "FullCommandName": [ "Get-AzVMwarePlacementPolicy_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -293,21 +293,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:27 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "338" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "910" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+UpdateViaIdentityExpanded+$PATCH+https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2021-12-01+2": { + "AzVMwarePlacementPolicy+[NoContext]+UpdateViaIdentityExpanded+$PATCH+https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2023-03-01+2": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/%7Bsubscription-id%7D/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"state\": \"Enabled\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -320,30 +320,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:27 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "339" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "911" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Disabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Disabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "74" ], - "x-ms-client-request-id": [ "c4aaa4e0-fedf-46a9-af98-7ea40702e16e" ], + "x-ms-client-request-id": [ "6bd18da8-0edc-4b24-89a3-422fc0a7468f" ], "CommandName": [ "Remove-AzVMwarePlacementPolicy" ], "FullCommandName": [ "Remove-AzVMwarePlacementPolicy_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -352,8 +352,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:28 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] @@ -362,19 +362,19 @@ "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01+1": { + "AzVMwarePlacementPolicy+[NoContext]+DeleteViaIdentity+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "75" ], - "x-ms-client-request-id": [ "82d23238-c201-462f-92ea-d0c8d1dbb868" ], + "x-ms-client-request-id": [ "57d91cf8-67c3-4db0-aa81-4f9f34576002" ], "CommandName": [ "Get-AzVMwarePlacementPolicy" ], "FullCommandName": [ "Get-AzVMwarePlacementPolicy_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -383,30 +383,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:28 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "338" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "910" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1\",\"name\":\"policy1\",\"type\":\"Microsoft.AVS/privateClouds/clusters/placementPolicies\",\"properties\":{\"type\":\"VmHost\",\"state\":\"Enabled\",\"displayName\":\"policy1\",\"provisioningState\":\"Succeeded\",\"vmMembers\":[\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256\"],\"hostMembers\":[\"fakehost22.nyc1.kubernetes.center\",\"fakehost23.nyc1.kubernetes.center\",\"fakehost24.nyc1.kubernetes.center\"],\"affinityType\":\"AntiAffinity\",\"affinityStrength\":\"Must\",\"azureHybridBenefitType\":\"SqlHost\"}}", "isContentBase64": false } }, - "AzVMwarePlacementPolicy+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2021-12-01+2": { + "AzVMwarePlacementPolicy+[NoContext]+DeleteViaIdentity+$DELETE+https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2023-03-01+2": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/%7Bsubscription-id%7D/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/placementPolicies/policy1?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "76" ], - "x-ms-client-request-id": [ "6f845be7-ed81-414b-8432-55d1ccb83164" ], + "x-ms-client-request-id": [ "ec79fb03-ab0f-4e7c-81c4-6974b1269b48" ], "CommandName": [ "Remove-AzVMwarePlacementPolicy" ], "FullCommandName": [ "Remove-AzVMwarePlacementPolicy_DeleteViaIdentity" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -415,8 +415,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:28 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:00 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Recording.json index 1c5a84e86a69..afea0bcf9591 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Recording.json @@ -1,8 +1,8 @@ { - "AzVMwarePrivateCloud+[NoContext]+List1+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+List1+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01", "Content": "{\r\n \"location\": \"centralus\",\r\n \"sku\": {\r\n \"name\": \"av36\"\r\n },\r\n \"properties\": {\r\n \"managementCluster\": {\r\n \"clusterSize\": 3\r\n },\r\n \"networkBlock\": \"192.168.48.0/22\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -15,31 +15,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:17:30 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:02 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1339" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1377" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+List1+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01+2": { + "AzVMwarePrivateCloud+[NoContext]+List1+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "78" ], - "x-ms-client-request-id": [ "216f75dd-1bf1-409d-9807-87249abc289e" ], + "x-ms-client-request-id": [ "6c1a9bc7-2552-4c9b-ae70-65dcb5847336" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwarePrivateCloud" ], "FullCommandName": [ "New-AzVMwarePrivateCloud_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -47,31 +47,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:00 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+List1+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01+3": { + "AzVMwarePrivateCloud+[NoContext]+List1+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "79" ], - "x-ms-client-request-id": [ "216f75dd-1bf1-409d-9807-87249abc289e" ], + "x-ms-client-request-id": [ "6c1a9bc7-2552-4c9b-ae70-65dcb5847336" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwarePrivateCloud" ], "FullCommandName": [ "New-AzVMwarePrivateCloud_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -79,30 +79,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:00 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+List1+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/privateClouds?api-version=2021-12-01+4": { + "AzVMwarePrivateCloud+[NoContext]+List1+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/privateClouds?api-version=2023-03-01+4": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/privateClouds?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/providers/Microsoft.AVS/privateClouds?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "80" ], - "x-ms-client-request-id": [ "8ac6617c-9a0e-433b-8f53-d29b015509df" ], + "x-ms-client-request-id": [ "dbba201c-c843-4bd5-adbe-e2347bda2c1d" ], "CommandName": [ "Get-AzVMwarePrivateCloud" ], "FullCommandName": [ "Get-AzVMwarePrivateCloud_List1" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -111,30 +111,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:00 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1452" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1509" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\"}}]}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/xdn238?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/l3cm9t?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "81" ], - "x-ms-client-request-id": [ "c0275b62-2450-4f5f-b0d9-522f7da9b6db" ], + "x-ms-client-request-id": [ "448e7e05-97bf-43b2-9b4c-55fb059e743e" ], "CommandName": [ "Get-AzVMwarePrivateCloud" ], "FullCommandName": [ "Get-AzVMwarePrivateCloud_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -143,30 +143,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:01 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "82" ], - "x-ms-client-request-id": [ "5dbbf429-9d71-4655-bcb8-dac7194c80a7" ], + "x-ms-client-request-id": [ "a80c955e-704d-41b8-880f-766401fd3d2f" ], "CommandName": [ "Get-AzVMwarePrivateCloud" ], "FullCommandName": [ "Get-AzVMwarePrivateCloud_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -175,21 +175,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:01 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1597" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1654" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}]}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+CreateExpanded+$PUT+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01+1": { "Request": { "Method": "PUT", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01", "Content": "{\r\n \"location\": \"centralus\",\r\n \"sku\": {\r\n \"name\": \"av20\"\r\n },\r\n \"properties\": {\r\n \"managementCluster\": {\r\n \"clusterSize\": 3\r\n },\r\n \"networkBlock\": \"192.168.48.0/22\"\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -202,31 +202,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:02 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:08:32 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1339" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1377" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01+2": { + "AzVMwarePrivateCloud+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01+2": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "84" ], - "x-ms-client-request-id": [ "336ee183-7c92-406f-8959-e7c6716a46d5" ], + "x-ms-client-request-id": [ "79018c20-51d1-45f7-9de6-ad4511a75afc" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwarePrivateCloud" ], "FullCommandName": [ "New-AzVMwarePrivateCloud_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -234,31 +234,31 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:33 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:02 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01+3": { + "AzVMwarePrivateCloud+[NoContext]+CreateExpanded+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01+3": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "Authorization": [ "[Filtered]" ], "x-ms-unique-id": [ "85" ], - "x-ms-client-request-id": [ "336ee183-7c92-406f-8959-e7c6716a46d5" ], + "x-ms-client-request-id": [ "79018c20-51d1-45f7-9de6-ad4511a75afc" ], "CommandName": [ "Az.VMware.internal\\New-AzVMwarePrivateCloud" ], "FullCommandName": [ "New-AzVMwarePrivateCloud_CreateExpanded" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ] + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ] }, "ContentHeaders": { } @@ -266,21 +266,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:33 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:02 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1933" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1990" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"keyState\":\"Connected\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]},\"identity\":{\"principalId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"tenantId\":\"881e5573-063f-49e4-8c08-79d7df0169d8\",\"type\":\"SystemAssigned\"}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+UpdateExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01+1": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"managementCluster\": {\r\n \"clusterSize\": 4\r\n }\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -293,21 +293,21 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:33 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:02 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1770" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1827" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+UpdateViaIdentityExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+UpdateViaIdentityExpanded+$PATCH+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel?api-version=2023-03-01+1": { "Request": { "Method": "PATCH", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloud7lcz?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudukel?api-version=2023-03-01", "Content": "{\r\n \"properties\": {\r\n \"managementCluster\": {\r\n \"clusterSize\": 4\r\n }\r\n }\r\n}", "isContentBase64": false, "Headers": { @@ -320,30 +320,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:34 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:02 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "1770" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "1827" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/{subscription-id}/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1\",\"name\":\"cloud1\",\"type\":\"Microsoft.AVS/privateClouds\",\"location\":\"eastus2\",\"tags\":{},\"sku\":{\"name\":\"AV36\"},\"properties\":{\"managementCluster\":{\"clusterSize\":4,\"clusterId\":1,\"hosts\":[\"fakehost18.nyc1.kubernetes.center\",\"fakehost19.nyc1.kubernetes.center\",\"fakehost20.nyc1.kubernetes.center\",\"fakehost21.nyc1.kubernetes.center\"]},\"internet\":\"Disabled\",\"identitySources\":[{\"name\":\"group1\",\"alias\":\"groupAlias\",\"domain\":\"domain1\",\"baseUserDN\":\"ou=baseUser\",\"baseGroupDN\":\"ou=baseGroup\",\"primaryServer\":\"ldaps://1.1.1.1:636/\",\"secondaryServer\":\"ldaps://1.1.1.2:636/\",\"ssl\":\"Enabled\"}],\"availability\":{\"strategy\":\"SingleZone\",\"zone\":1},\"encryption\":{\"status\":\"Enabled\",\"keyVaultProperties\":{\"keyName\":\"keyname1\",\"keyVersion\":\"ver1.0\",\"keyVaultUrl\":\"https://keyvault1-kmip-kvault.vault.azure.net/\",\"versionType\":\"Fixed\"}},\"provisioningState\":\"Succeeded\",\"circuit\":{\"primarySubnet\":\"192.168.53.0/30\",\"secondarySubnet\":\"192.168.53.4/30\",\"expressRouteID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2/providers/Microsoft.Network/expressroutecircuits/tnt13-41a90db2-9d5e-4bd5-a77a-5ce7b58213d6-eastus2-xconnect\",\"expressRoutePrivatePeeringID\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tnt42-cust-p01-dmo01/providers/Microsoft.Network/expressroutecircuits/tnt42-cust-p01-dmo01-er/peerings/AzurePrivatePeering\"},\"endpoints\":{\"nsxtManager\":\"https://192.168.50.3/\",\"vcsa\":\"https://192.168.50.2/\",\"hcxCloudManager\":\"https://192.168.50.4/\"},\"networkBlock\":\"192.168.48.0/22\",\"externalCloudLinks\":[\"/subscriptions/12341234-1234-1234-1234-123412341234/resourceGroups/mygroup/providers/Microsoft.AVS/privateClouds/cloud2\"]}}", "isContentBase64": false } }, - "AzVMwarePrivateCloud+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01+1": { + "AzVMwarePrivateCloud+[NoContext]+Delete+$DELETE+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01+1": { "Request": { "Method": "DELETE", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/s7vnbc?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/5krpza?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "88" ], - "x-ms-client-request-id": [ "346f8298-f82f-4ee4-8ee3-c6963dc82348" ], + "x-ms-client-request-id": [ "d58fe77d-3d1f-4f50-a19e-773ee4e4fa33" ], "CommandName": [ "Az.VMware.internal\\Remove-AzVMwarePrivateCloud" ], "FullCommandName": [ "Remove-AzVMwarePrivateCloud_Delete" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -352,8 +352,8 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:34 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:02 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Tests.ps1 b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Tests.ps1 index 670aa98095b1..78695c58e5e5 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Tests.ps1 +++ b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloud.Tests.ps1 @@ -45,7 +45,7 @@ Describe 'AzVMwarePrivateCloud' { It 'UpdateExpanded' { { - $config = Update-AzVMwarePrivateCloud -Name $env.privateCloudName1 -ResourceGroupName $env.resourceGroup1 -ManagementClusterSize 4 + $config = Update-AzVMwarePrivateCloud -Name $env.rstr2 -ResourceGroupName $env.resourceGroup2 -ManagementClusterSize 4 $config.ManagementClusterSize | Should -BeGreaterThan 0 } | Should -Not -Throw } diff --git a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudAdminCredential.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudAdminCredential.Recording.json index 87691b04f4b0..3b938678240d 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudAdminCredential.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudAdminCredential.Recording.json @@ -1,17 +1,17 @@ { - "AzVMwarePrivateCloudAdminCredential+[NoContext]+List+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/listAdminCredentials?api-version=2021-12-01+1": { + "AzVMwarePrivateCloudAdminCredential+[NoContext]+List+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/listAdminCredentials?api-version=2023-03-01+1": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/listAdminCredentials?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/listAdminCredentials?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "89" ], - "x-ms-client-request-id": [ "34fd3299-909c-4a5d-91a8-ffebf354082b" ], + "x-ms-client-request-id": [ "6f1aa896-b5de-4a1a-9738-cac82b9dd4a1" ], "CommandName": [ "Get-AzVMwarePrivateCloudAdminCredential" ], "FullCommandName": [ "Get-AzVMwarePrivateCloudAdminCredential_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -20,12 +20,12 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:35 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:02 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "133" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "133" ] }, "Content": "{\"nsxtUsername\":\"admin\",\"nsxtPassword\":\"$(1X4Dkk\",\"vcenterUsername\":\"cloudadmin@vsphere.local\",\"vcenterPassword\":\"\u003cvcenterPassword\u003e\"}", "isContentBase64": false diff --git a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudNsxtPassword.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudNsxtPassword.Recording.json index 50464a329fff..b5328d5327d0 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudNsxtPassword.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudNsxtPassword.Recording.json @@ -1,17 +1,17 @@ { - "AzVMwarePrivateCloudNsxtPassword+[NoContext]+Rotate+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/rotateNsxtPassword?api-version=2021-12-01+1": { + "AzVMwarePrivateCloudNsxtPassword+[NoContext]+Rotate+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/rotateNsxtPassword?api-version=2023-03-01+1": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/rotateNsxtPassword?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/rotateNsxtPassword?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "90" ], - "x-ms-client-request-id": [ "f321546c-be92-469a-a767-c9a64592b522" ], + "x-ms-client-request-id": [ "436cacf4-5b03-4bb6-a386-e079722c88b5" ], "CommandName": [ "New-AzVMwarePrivateCloudNsxtPassword" ], "FullCommandName": [ "New-AzVMwarePrivateCloudNsxtPassword_Rotate" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -20,8 +20,8 @@ "Response": { "StatusCode": 204, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:35 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:04 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudVcenterPassword.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudVcenterPassword.Recording.json index 0ed98c531e9d..777d3111cbcc 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudVcenterPassword.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwarePrivateCloudVcenterPassword.Recording.json @@ -1,17 +1,17 @@ { - "AzVMwarePrivateCloudVcenterPassword+[NoContext]+Rotate+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/rotateVcenterPassword?api-version=2021-12-01+1": { + "AzVMwarePrivateCloudVcenterPassword+[NoContext]+Rotate+$POST+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/rotateVcenterPassword?api-version=2023-03-01+1": { "Request": { "Method": "POST", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/rotateVcenterPassword?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/rotateVcenterPassword?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "91" ], - "x-ms-client-request-id": [ "ab9f4ff3-a4c8-4a8c-9bbb-670742e5cf40" ], + "x-ms-client-request-id": [ "6a48e146-4234-42ad-af61-4274e92e9796" ], "CommandName": [ "New-AzVMwarePrivateCloudVcenterPassword" ], "FullCommandName": [ "New-AzVMwarePrivateCloudVcenterPassword_Rotate" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -20,8 +20,8 @@ "Response": { "StatusCode": 204, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:37 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:04 GMT" ] }, "ContentHeaders": { "Content-Length": [ "0" ] diff --git a/src/VMware/VMware.Autorest/test/AzVMwareVirtualMachine.Recording.json b/src/VMware/VMware.Autorest/test/AzVMwareVirtualMachine.Recording.json index 20130d47d500..c7dfa430da12 100644 --- a/src/VMware/VMware.Autorest/test/AzVMwareVirtualMachine.Recording.json +++ b/src/VMware/VMware.Autorest/test/AzVMwareVirtualMachine.Recording.json @@ -1,17 +1,17 @@ { - "AzVMwareVirtualMachine+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/virtualMachines?api-version=2021-12-01+1": { + "AzVMwareVirtualMachine+[NoContext]+List+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/virtualMachines?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/virtualMachines?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/virtualMachines?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "92" ], - "x-ms-client-request-id": [ "4946c755-4741-490b-90e4-f5ff1687cb69" ], + "x-ms-client-request-id": [ "487d45e8-6a95-48fe-ac02-82b83d881a1f" ], "CommandName": [ "Get-AzVMwareVirtualMachine" ], "FullCommandName": [ "Get-AzVMwareVirtualMachine_List" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -20,30 +20,30 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:39 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:06 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "695" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "733" ] }, - "Content": "{\"value\":[{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-209\",\"name\":\"vm-209\",\"type\":\"Microsoft.AVS/privateClouds/clusters/virtualMachines\",\"properties\":{\"displayName\":\"contoso-vm1\",\"moRefId\":\"vm-209\",\"folderPath\":\"vm/folder-1\",\"restrictMovement\":\"Disabled\"}},{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"name\":\"vm-128\",\"type\":\"Microsoft.AVS/privateClouds/clusters/virtualMachines\",\"properties\":{\"displayName\":\"contoso-vm2\",\"moRefId\":\"vm-128\",\"folderPath\":\"vm\",\"restrictMovement\":\"Enabled\"}}]}", + "Content": "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-209\",\"name\":\"vm-209\",\"type\":\"Microsoft.AVS/privateClouds/clusters/virtualMachines\",\"properties\":{\"displayName\":\"contoso-vm1\",\"moRefId\":\"vm-209\",\"folderPath\":\"vm/folder-1\",\"restrictMovement\":\"Disabled\"}},{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128\",\"name\":\"vm-128\",\"type\":\"Microsoft.AVS/privateClouds/clusters/virtualMachines\",\"properties\":{\"displayName\":\"contoso-vm2\",\"moRefId\":\"vm-128\",\"folderPath\":\"vm\",\"restrictMovement\":\"Enabled\"}}]}", "isContentBase64": false } }, - "AzVMwareVirtualMachine+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/virtualMachines/vm-209?api-version=2021-12-01+1": { + "AzVMwareVirtualMachine+[NoContext]+Get+$GET+https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/virtualMachines/vm-209?api-version=2023-03-01+1": { "Request": { "Method": "GET", - "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroup5q2kvd/providers/Microsoft.AVS/privateClouds/azps_test_cloudme6g/clusters/xdn238/virtualMachines/vm-209?api-version=2021-12-01", + "RequestUri": "https://management.azure.com/subscriptions/cef41485-ad1e-4cc3-a652-4c2620b8a2d0/resourceGroups/testgroupp9uh7g/providers/Microsoft.AVS/privateClouds/azps_test_cloudb092/clusters/l3cm9t/virtualMachines/vm-209?api-version=2023-03-01", "Content": null, "isContentBase64": false, "Headers": { "x-ms-unique-id": [ "93" ], - "x-ms-client-request-id": [ "82925d7b-077e-4c2f-b721-72c569ecfebf" ], + "x-ms-client-request-id": [ "5aee0f03-bbb5-4e4b-829f-711bd8e4771b" ], "CommandName": [ "Get-AzVMwareVirtualMachine" ], "FullCommandName": [ "Get-AzVMwareVirtualMachine_Get" ], "ParameterSetName": [ "__AllParameterSets" ], - "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.1.2", "Az.VMware/0.4.0" ], + "User-Agent": [ "AzurePowershell/v0.0.0", "PSVersion/v7.3.9", "Az.VMware/0.4.0" ], "Authorization": [ "[Filtered]" ] }, "ContentHeaders": { @@ -52,14 +52,14 @@ "Response": { "StatusCode": 200, "Headers": { - "Date": [ "Thu, 22 Sep 2022 07:18:39 GMT" ], - "Server": [ "Rocket" ] + "Server": [ "Rocket" ], + "Date": [ "Fri, 12 Jan 2024 19:09:06 GMT" ] }, "ContentHeaders": { - "Content-Length": [ "345" ], - "Content-Type": [ "application/json" ] + "Content-Type": [ "application/json" ], + "Content-Length": [ "364" ] }, - "Content": "{\"id\":\"/subscriptions/{subscription-id}/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-209\",\"name\":\"vm-209\",\"type\":\"Microsoft.AVS/privateClouds/clusters/virtualMachines\",\"properties\":{\"displayName\":\"contoso-vm\",\"moRefId\":\"vm-209\",\"folderPath\":\"vm/folder-1\",\"restrictMovement\":\"Disabled\"}}", + "Content": "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-209\",\"name\":\"vm-209\",\"type\":\"Microsoft.AVS/privateClouds/clusters/virtualMachines\",\"properties\":{\"displayName\":\"contoso-vm\",\"moRefId\":\"vm-209\",\"folderPath\":\"vm/folder-1\",\"restrictMovement\":\"Disabled\"}}", "isContentBase64": false } } diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareClusterZone.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareClusterZone.Tests.ps1 new file mode 100644 index 000000000000..737bc8ca3431 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareClusterZone.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareClusterZone')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareClusterZone.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareClusterZone' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareHcxEnterpriseSite.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareHcxEnterpriseSite.Tests.ps1 new file mode 100644 index 000000000000..89311aa1af0c --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareHcxEnterpriseSite.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareHcxEnterpriseSite')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareHcxEnterpriseSite.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareHcxEnterpriseSite' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptCmdlet.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptCmdlet.Tests.ps1 new file mode 100644 index 000000000000..e9655ace0b64 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptCmdlet.Tests.ps1 @@ -0,0 +1,37 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareScriptCmdlet')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareScriptCmdlet.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareScriptCmdlet' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityScriptPackage' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptExecution.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptExecution.Tests.ps1 new file mode 100644 index 000000000000..d9534a0a9a9a --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptExecution.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareScriptExecution')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareScriptExecution.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareScriptExecution' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptExecutionLog.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptExecutionLog.Tests.ps1 new file mode 100644 index 000000000000..3b46faa60259 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptExecutionLog.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareScriptExecutionLog')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareScriptExecutionLog.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareScriptExecutionLog' { + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptPackage.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptPackage.Tests.ps1 new file mode 100644 index 000000000000..71c66d4f2cb0 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareScriptPackage.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareScriptPackage')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareScriptPackage.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareScriptPackage' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDhcp.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDhcp.Tests.ps1 new file mode 100644 index 000000000000..dba14cba8e63 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDhcp.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkDhcp')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkDhcp.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkDhcp' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityDhcpConfiguration' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDnsService.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDnsService.Tests.ps1 new file mode 100644 index 000000000000..0e3c09332db1 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDnsService.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkDnsService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkDnsService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkDnsService' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 new file mode 100644 index 000000000000..a85c44c5a4d6 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkDnsZone')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkDnsZone.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkDnsZone' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkGateway.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkGateway.Tests.ps1 new file mode 100644 index 000000000000..5df06083b2ad --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkGateway.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkGateway')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkGateway.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkGateway' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 new file mode 100644 index 000000000000..7d59ec297aa4 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkPortMirroring')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkPortMirroring.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkPortMirroring' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 new file mode 100644 index 000000000000..9f363e639173 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkPublicIP')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkPublicIP.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkPublicIP' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkSegment.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkSegment.Tests.ps1 new file mode 100644 index 000000000000..ef41313a2d72 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkSegment.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkSegment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkSegment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkSegment' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkVM.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkVM.Tests.ps1 new file mode 100644 index 000000000000..b5fe2d005104 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkVM.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkVM')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkVM.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkVM' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 new file mode 100644 index 000000000000..c74b41f06012 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Get-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzVMwareWorkloadNetworkVMGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzVMwareWorkloadNetworkVMGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzVMwareWorkloadNetworkVMGroup' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Lock-AzVMwareVirtualMachineMovement.Tests.ps1 b/src/VMware/VMware.Autorest/test/Lock-AzVMwareVirtualMachineMovement.Tests.ps1 new file mode 100644 index 000000000000..97c749c0b9e6 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Lock-AzVMwareVirtualMachineMovement.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Lock-AzVMwareVirtualMachineMovement')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Lock-AzVMwareVirtualMachineMovement.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Lock-AzVMwareVirtualMachineMovement' { + It 'RestrictExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestrictViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestrictViaIdentityClusterExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestrictViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareHcxEnterpriseSite.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareHcxEnterpriseSite.Tests.ps1 new file mode 100644 index 000000000000..9514254882e3 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareHcxEnterpriseSite.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareHcxEnterpriseSite')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareHcxEnterpriseSite.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareHcxEnterpriseSite' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareIdentitySourceObject.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareIdentitySourceObject.Tests.ps1 new file mode 100644 index 000000000000..68b66358de65 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareIdentitySourceObject.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareIdentitySourceObject')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareIdentitySourceObject.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareIdentitySourceObject' { + It '__AllParameterSets' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareScriptExecution.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareScriptExecution.Tests.ps1 new file mode 100644 index 000000000000..874c9928fea9 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareScriptExecution.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareScriptExecution')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareScriptExecution.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareScriptExecution' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDhcp.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDhcp.Tests.ps1 new file mode 100644 index 000000000000..4368f0fb5a36 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDhcp.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkDhcp')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkDhcp.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkDhcp' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDnsService.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDnsService.Tests.ps1 new file mode 100644 index 000000000000..1ecfc96b3937 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDnsService.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkDnsService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkDnsService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkDnsService' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 new file mode 100644 index 000000000000..356e2cbb2821 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkDnsZone')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkDnsZone.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkDnsZone' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 new file mode 100644 index 000000000000..b71f9b7f0f34 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkPortMirroring')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkPortMirroring.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkPortMirroring' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 new file mode 100644 index 000000000000..64888706de6f --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkPublicIP')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkPublicIP.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkPublicIP' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkSegment.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkSegment.Tests.ps1 new file mode 100644 index 000000000000..8fb2beba215c --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkSegment.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkSegment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkSegment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkSegment' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 new file mode 100644 index 000000000000..7b6982940eb6 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/New-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzVMwareWorkloadNetworkVMGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzVMwareWorkloadNetworkVMGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzVMwareWorkloadNetworkVMGroup' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CreateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareHcxEnterpriseSite.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareHcxEnterpriseSite.Tests.ps1 new file mode 100644 index 000000000000..1635ff2ada7b --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareHcxEnterpriseSite.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareHcxEnterpriseSite')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareHcxEnterpriseSite.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareHcxEnterpriseSite' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareScriptExecution.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareScriptExecution.Tests.ps1 new file mode 100644 index 000000000000..c29e29a921b8 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareScriptExecution.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareScriptExecution')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareScriptExecution.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareScriptExecution' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDhcp.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDhcp.Tests.ps1 new file mode 100644 index 000000000000..acbbf49e1349 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDhcp.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkDhcp')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkDhcp.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkDhcp' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDnsService.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDnsService.Tests.ps1 new file mode 100644 index 000000000000..24d2e0700488 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDnsService.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkDnsService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkDnsService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkDnsService' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityDnsService' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 new file mode 100644 index 000000000000..5d38d5bef198 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkDnsZone')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkDnsZone.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkDnsZone' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityDnsZone' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 new file mode 100644 index 000000000000..19a0320abe20 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkPortMirroring')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkPortMirroring.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkPortMirroring' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityPortMirroringProfile' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 new file mode 100644 index 000000000000..7a04da91f302 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkPublicIP.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkPublicIP')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkPublicIP.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkPublicIP' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityPublicIP' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkSegment.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkSegment.Tests.ps1 new file mode 100644 index 000000000000..1713e34a1b5a --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkSegment.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkSegment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkSegment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkSegment' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityPrivateCloud' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 new file mode 100644 index 000000000000..d209b536fcf9 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Remove-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzVMwareWorkloadNetworkVMGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzVMwareWorkloadNetworkVMGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzVMwareWorkloadNetworkVMGroup' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentityVMGroup' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Test-AzVMWareLocationTrialAvailability.Tests.ps1 b/src/VMware/VMware.Autorest/test/Test-AzVMWareLocationTrialAvailability.Tests.ps1 index 1e9df0676cbd..c67a26942bfc 100644 --- a/src/VMware/VMware.Autorest/test/Test-AzVMWareLocationTrialAvailability.Tests.ps1 +++ b/src/VMware/VMware.Autorest/test/Test-AzVMWareLocationTrialAvailability.Tests.ps1 @@ -15,7 +15,15 @@ if(($null -eq $TestName) -or ($TestName -contains 'Test-AzVMwareLocationTrialAva } Describe 'Test-AzVMwareLocationTrialAvailability' { + It 'CheckExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + It 'Check' -skip { { throw [System.NotImplementedException] } | Should -Not -Throw } + + It 'CheckViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } } diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareAuthorization.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareAuthorization.Tests.ps1 new file mode 100644 index 000000000000..6f707fa2d5f7 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareAuthorization.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareAuthorization')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareAuthorization.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareAuthorization' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareCloudLink.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareCloudLink.Tests.ps1 new file mode 100644 index 000000000000..965bf8bd2896 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareCloudLink.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareCloudLink')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareCloudLink.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareCloudLink' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareDatastore.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareDatastore.Tests.ps1 new file mode 100644 index 000000000000..a8dd6e5260f9 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareDatastore.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareDatastore')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareDatastore.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareDatastore' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityClusterExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareGlobalReachConnection.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareGlobalReachConnection.Tests.ps1 new file mode 100644 index 000000000000..37257fa49cc1 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareGlobalReachConnection.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareGlobalReachConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareGlobalReachConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareGlobalReachConnection' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDhcp.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDhcp.Tests.ps1 new file mode 100644 index 000000000000..be8360833da0 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDhcp.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareWorkloadNetworkDhcp')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareWorkloadNetworkDhcp.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareWorkloadNetworkDhcp' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDnsService.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDnsService.Tests.ps1 new file mode 100644 index 000000000000..803cc65ee578 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDnsService.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareWorkloadNetworkDnsService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareWorkloadNetworkDnsService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareWorkloadNetworkDnsService' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 new file mode 100644 index 000000000000..45c273f985b0 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkDnsZone.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareWorkloadNetworkDnsZone')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareWorkloadNetworkDnsZone.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareWorkloadNetworkDnsZone' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 new file mode 100644 index 000000000000..b8ec8a149855 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkPortMirroring.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareWorkloadNetworkPortMirroring')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareWorkloadNetworkPortMirroring.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareWorkloadNetworkPortMirroring' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkSegment.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkSegment.Tests.ps1 new file mode 100644 index 000000000000..e6c18c756cd1 --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkSegment.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareWorkloadNetworkSegment')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareWorkloadNetworkSegment.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareWorkloadNetworkSegment' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 new file mode 100644 index 000000000000..12eaf3e48a0f --- /dev/null +++ b/src/VMware/VMware.Autorest/test/Update-AzVMwareWorkloadNetworkVMGroup.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzVMwareWorkloadNetworkVMGroup')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzVMwareWorkloadNetworkVMGroup.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzVMwareWorkloadNetworkVMGroup' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityPrivateCloudExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/src/VMware/VMware.Autorest/test/env.json b/src/VMware/VMware.Autorest/test/env.json index 46a261126468..412e67e74c6f 100644 --- a/src/VMware/VMware.Autorest/test/env.json +++ b/src/VMware/VMware.Autorest/test/env.json @@ -1,18 +1,18 @@ { - "resourceGroup3": "testgroup5q2kvd", - "rstr1": "xdn238", - "rstr2": "s7vnbc", + "resourceGroup2": "testgroupp9uh7g", + "rstr4": "p9uh7g", + "policy1": "policy1", + "privateCloudName2": "azps_test_cloudukel", + "rstr3": "2hlsk5", + "location1": "centralus", + "rstr1": "l3cm9t", "Tenant": "72f988bf-86f1-41af-91ab-2d7cd011db47", "SubscriptionId": "cef41485-ad1e-4cc3-a652-4c2620b8a2d0", - "privateCloudName2": "azps_test_cloud7lcz", - "location1": "centralus", - "rstr3": "yrles9", - "rstr4": "5q2kvd", + "resourceGroup3": "testgroupp9uh7g", + "rstr2": "5krpza", + "privateCloudName1": "azps_test_cloudb092", + "policy2": "policy2", + "privateCloudName3": "azps_test_cloudaoz1", "location2": "westcentralus", - "resourceGroup2": "testgroup5q2kvd", - "resourceGroup1": "testgroup5q2kvd", - "policy1": "policy1", - "privateCloudName3": "azps_test_cloudbeog", - "privateCloudName1": "azps_test_cloudme6g", - "policy2": "policy2" + "resourceGroup1": "testgroupp9uh7g" } diff --git a/src/VMware/VMware/Az.VMware.psd1 b/src/VMware/VMware/Az.VMware.psd1 index febbd2e080a8..f6a0ac4b5bba 100644 --- a/src/VMware/VMware/Az.VMware.psd1 +++ b/src/VMware/VMware/Az.VMware.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 12/5/2023 +# Generated on: 1/26/2024 # @{ @@ -51,7 +51,7 @@ DotNetFrameworkVersion = '4.7.2' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.10.2'; }) +RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.15.0'; }) # Assemblies that must be loaded prior to importing this module RequiredAssemblies = 'VMware.Autorest/bin/Az.VMware.private.dll' @@ -71,16 +71,17 @@ NestedModules = @('VMware.Autorest/Az.VMware.psm1') # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization', 'Get-AzVMwareCloudLink', 'Get-AzVMwareCluster', - 'Get-AzVMwareDatastore', 'Get-AzVMwareGlobalReachConnection', - 'Get-AzVMwarePlacementPolicy', 'Get-AzVMwarePrivateCloud', + 'Get-AzVMwareClusterZone', 'Get-AzVMwareDatastore', + 'Get-AzVMwareGlobalReachConnection', 'Get-AzVMwarePlacementPolicy', + 'Get-AzVMwarePrivateCloud', 'Get-AzVMwarePrivateCloudAdminCredential', 'Get-AzVMwareVirtualMachine', 'New-AzVMwareAddon', 'New-AzVMwareAddonSrmPropertiesObject', 'New-AzVMwareAddonVrPropertiesObject', 'New-AzVMwareAuthorization', 'New-AzVMwareCloudLink', 'New-AzVMwareCluster', 'New-AzVMwareDatastore', 'New-AzVMwareGlobalReachConnection', - 'New-AzVMwarePlacementPolicy', 'New-AzVMwarePrivateCloud', - 'New-AzVMwarePrivateCloudNsxtPassword', + 'New-AzVMwareIdentitySourceObject', 'New-AzVMwarePlacementPolicy', + 'New-AzVMwarePrivateCloud', 'New-AzVMwarePrivateCloudNsxtPassword', 'New-AzVMwarePrivateCloudVcenterPassword', 'New-AzVMwarePSCredentialExecutionParameterObject', 'New-AzVMwareScriptSecureStringExecutionParameterObject', @@ -92,7 +93,10 @@ FunctionsToExport = 'Get-AzVMwareAddon', 'Get-AzVMwareAuthorization', 'Remove-AzVMwareDatastore', 'Remove-AzVMwareGlobalReachConnection', 'Remove-AzVMwarePlacementPolicy', 'Remove-AzVMwarePrivateCloud', 'Test-AzVMwareLocationQuotaAvailability', - 'Test-AzVMwareLocationTrialAvailability', 'Update-AzVMwareCluster', + 'Test-AzVMwareLocationTrialAvailability', + 'Update-AzVMwareAuthorization', 'Update-AzVMwareCloudLink', + 'Update-AzVMwareCluster', 'Update-AzVMwareDatastore', + 'Update-AzVMwareGlobalReachConnection', 'Update-AzVMwarePlacementPolicy', 'Update-AzVMwarePrivateCloud' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. diff --git a/src/VMware/VMware/ChangeLog.md b/src/VMware/VMware/ChangeLog.md index f7556db1c966..8fd2fd10ec90 100644 --- a/src/VMware/VMware/ChangeLog.md +++ b/src/VMware/VMware/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Updated api version to `2023-03-01` ## Version 0.5.0 * Added cmdlet: diff --git a/src/VMware/VMware/help/Get-AzVMwareAddon.md b/src/VMware/VMware/help/Get-AzVMwareAddon.md index 732e3f8e3244..67c8c926c1b2 100644 --- a/src/VMware/VMware/help/Get-AzVMwareAddon.md +++ b/src/VMware/VMware/help/Get-AzVMwareAddon.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareaddon schema: 2.0.0 @@ -20,8 +20,8 @@ Get-AzVMwareAddon -PrivateCloudName -ResourceGroupName [-Subsc ### Get ``` -Get-AzVMwareAddon -AddonType -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [] +Get-AzVMwareAddon -PrivateCloudName -ResourceGroupName [-SubscriptionId ] + -AddonType [-DefaultProfile ] [] ``` ### GetViaIdentity @@ -114,7 +114,7 @@ Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -130,7 +130,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -145,7 +145,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -203,4 +203,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwareAuthorization.md b/src/VMware/VMware/help/Get-AzVMwareAuthorization.md index 7df8e7fcd67a..2bcc0b6e1c05 100644 --- a/src/VMware/VMware/help/Get-AzVMwareAuthorization.md +++ b/src/VMware/VMware/help/Get-AzVMwareAuthorization.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareauthorization schema: 2.0.0 @@ -18,6 +18,12 @@ Get-AzVMwareAuthorization -PrivateCloudName -ResourceGroupName [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + ### Get ``` Get-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName @@ -98,7 +104,7 @@ Name of the ExpressRoute Circuit Authorization in the private cloud ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get Aliases: AuthorizationName Required: True @@ -108,12 +114,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -129,7 +151,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -144,7 +166,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -202,4 +224,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwareCloudLink.md b/src/VMware/VMware/help/Get-AzVMwareCloudLink.md index eb546e9e008a..8b9c5ea24322 100644 --- a/src/VMware/VMware/help/Get-AzVMwareCloudLink.md +++ b/src/VMware/VMware/help/Get-AzVMwareCloudLink.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecloudlink schema: 2.0.0 @@ -18,6 +18,12 @@ Get-AzVMwareCloudLink -PrivateCloudName -ResourceGroupName [-S [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareCloudLink -Name -PrivateCloudInputObject [-DefaultProfile ] + [] +``` + ### Get ``` Get-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName @@ -98,7 +104,7 @@ Name of the cloud link resource ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get Aliases: CloudLinkName Required: True @@ -108,12 +114,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -129,7 +151,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -144,7 +166,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -202,4 +224,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwareCluster.md b/src/VMware/VMware/help/Get-AzVMwareCluster.md index 322b663bea83..e5681b64abec 100644 --- a/src/VMware/VMware/help/Get-AzVMwareCluster.md +++ b/src/VMware/VMware/help/Get-AzVMwareCluster.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarecluster schema: 2.0.0 @@ -18,6 +18,12 @@ Get-AzVMwareCluster -PrivateCloudName -ResourceGroupName [-Sub [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareCluster -Name -PrivateCloudInputObject [-DefaultProfile ] + [] +``` + ### Get ``` Get-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName @@ -98,7 +104,7 @@ Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get Aliases: ClusterName Required: True @@ -108,12 +114,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -129,7 +151,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -144,7 +166,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -202,4 +224,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwareClusterZone.md b/src/VMware/VMware/help/Get-AzVMwareClusterZone.md new file mode 100644 index 000000000000..c2e7a13065f2 --- /dev/null +++ b/src/VMware/VMware/help/Get-AzVMwareClusterZone.md @@ -0,0 +1,153 @@ +--- +external help file: Az.VMware-help.xml +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareclusterzone +schema: 2.0.0 +--- + +# Get-AzVMwareClusterZone + +## SYNOPSIS +List hosts by zone in a cluster + +## SYNTAX + +``` +Get-AzVMwareClusterZone -ClusterName -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +List hosts by zone in a cluster + +## EXAMPLES + +### EXAMPLE 1 +``` +Get-AzVMwareClusterZone -PrivateCloudName SDDC2 -ResourceGroupName TestSddc-rg -ClusterName Cluster-1 +``` + +## PARAMETERS + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IClusterZoneList +## NOTES + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareclusterzone](https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareclusterzone) + diff --git a/src/VMware/VMware/help/Get-AzVMwareDatastore.md b/src/VMware/VMware/help/Get-AzVMwareDatastore.md index 93a2cff2dc55..3353754b95b9 100644 --- a/src/VMware/VMware/help/Get-AzVMwareDatastore.md +++ b/src/VMware/VMware/help/Get-AzVMwareDatastore.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwaredatastore schema: 2.0.0 @@ -18,12 +18,24 @@ Get-AzVMwareDatastore -ClusterName -PrivateCloudName -Resource [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + ### Get ``` Get-AzVMwareDatastore -ClusterName -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityCluster +``` +Get-AzVMwareDatastore -Name -ClusterInputObject [-DefaultProfile ] + [] +``` + ### GetViaIdentity ``` Get-AzVMwareDatastore -InputObject [-DefaultProfile ] [] @@ -63,12 +75,28 @@ Get a datastore in a data store name. ## PARAMETERS +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, GetViaIdentityPrivateCloud, Get Aliases: Required: True @@ -114,7 +142,7 @@ Name of the datastore in the private cloud cluster ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get, GetViaIdentityCluster Aliases: DatastoreName Required: True @@ -124,12 +152,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -145,7 +189,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -160,7 +204,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -218,4 +262,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwareGlobalReachConnection.md b/src/VMware/VMware/help/Get-AzVMwareGlobalReachConnection.md index 8b2ef86c559e..37327c5c4998 100644 --- a/src/VMware/VMware/help/Get-AzVMwareGlobalReachConnection.md +++ b/src/VMware/VMware/help/Get-AzVMwareGlobalReachConnection.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareglobalreachconnection schema: 2.0.0 @@ -18,6 +18,12 @@ Get-AzVMwareGlobalReachConnection -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + ### Get ``` Get-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName @@ -99,7 +105,7 @@ Name of the global reach connection in the private cloud ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get Aliases: GlobalReachConnectionName Required: True @@ -109,12 +115,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -130,7 +152,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -145,7 +167,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -203,4 +225,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwarePlacementPolicy.md b/src/VMware/VMware/help/Get-AzVMwarePlacementPolicy.md index 3ba99868b271..fdf0bc8d7dec 100644 --- a/src/VMware/VMware/help/Get-AzVMwarePlacementPolicy.md +++ b/src/VMware/VMware/help/Get-AzVMwarePlacementPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareplacementpolicy schema: 2.0.0 @@ -18,12 +18,24 @@ Get-AzVMwarePlacementPolicy -ClusterName -PrivateCloudName -Re [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + ### Get ``` Get-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityCluster +``` +Get-AzVMwarePlacementPolicy -Name -ClusterInputObject [-DefaultProfile ] + [] +``` + ### GetViaIdentity ``` Get-AzVMwarePlacementPolicy -InputObject [-DefaultProfile ] [] @@ -63,12 +75,28 @@ Get a placement policy by name in a private cloud cluster ## PARAMETERS +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, GetViaIdentityPrivateCloud, Get Aliases: Required: True @@ -114,7 +142,7 @@ Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get, GetViaIdentityCluster Aliases: PlacementPolicyName Required: True @@ -124,12 +152,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -145,7 +189,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -160,7 +204,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -218,4 +262,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwarePrivateCloud.md b/src/VMware/VMware/help/Get-AzVMwarePrivateCloud.md index 12e3e3862592..fa97346a58f0 100644 --- a/src/VMware/VMware/help/Get-AzVMwarePrivateCloud.md +++ b/src/VMware/VMware/help/Get-AzVMwarePrivateCloud.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloud schema: 2.0.0 @@ -23,17 +23,17 @@ Get-AzVMwarePrivateCloud -Name -ResourceGroupName [-Subscripti [-DefaultProfile ] [] ``` -### GetViaIdentity -``` -Get-AzVMwarePrivateCloud -InputObject [-DefaultProfile ] [] -``` - ### List ``` Get-AzVMwarePrivateCloud -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentity +``` +Get-AzVMwarePrivateCloud -InputObject [-DefaultProfile ] [] +``` + ## DESCRIPTION Get a private cloud @@ -147,7 +147,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List, List1 +Parameter Sets: List1, Get, List Aliases: Required: False @@ -205,4 +205,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwarePrivateCloudAdminCredential.md b/src/VMware/VMware/help/Get-AzVMwarePrivateCloudAdminCredential.md index d56e37ee6c45..1fe8650b4801 100644 --- a/src/VMware/VMware/help/Get-AzVMwarePrivateCloudAdminCredential.md +++ b/src/VMware/VMware/help/Get-AzVMwarePrivateCloudAdminCredential.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwareprivatecloudadmincredential schema: 2.0.0 @@ -14,7 +14,7 @@ List the admin credentials for the private cloud ``` Get-AzVMwarePrivateCloudAdminCredential -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-SubscriptionId ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -143,4 +143,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Get-AzVMwareVirtualMachine.md b/src/VMware/VMware/help/Get-AzVMwareVirtualMachine.md index c49a23dc68c5..a0c5c9ac7dcc 100644 --- a/src/VMware/VMware/help/Get-AzVMwareVirtualMachine.md +++ b/src/VMware/VMware/help/Get-AzVMwareVirtualMachine.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/get-azvmwarevirtualmachine schema: 2.0.0 @@ -18,12 +18,24 @@ Get-AzVMwareVirtualMachine -ClusterName -PrivateCloudName -Res [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityPrivateCloud +``` +Get-AzVMwareVirtualMachine -ClusterName -Id -PrivateCloudInputObject + [-DefaultProfile ] [] +``` + ### Get ``` Get-AzVMwareVirtualMachine -ClusterName -Id -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [] ``` +### GetViaIdentityCluster +``` +Get-AzVMwareVirtualMachine -Id -ClusterInputObject [-DefaultProfile ] + [] +``` + ### GetViaIdentity ``` Get-AzVMwareVirtualMachine -InputObject [-DefaultProfile ] [] @@ -63,12 +75,28 @@ Get a virtual machine by id in a private cloud cluster ## PARAMETERS +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, GetViaIdentityPrivateCloud, Get Aliases: Required: True @@ -98,7 +126,7 @@ Virtual Machine identifier ```yaml Type: System.String -Parameter Sets: Get +Parameter Sets: GetViaIdentityPrivateCloud, Get, GetViaIdentityCluster Aliases: VirtualMachineId Required: True @@ -124,12 +152,28 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: GetViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -145,7 +189,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: True @@ -160,7 +204,7 @@ The ID of the target subscription. ```yaml Type: System.String[] -Parameter Sets: Get, List +Parameter Sets: List, Get Aliases: Required: False @@ -218,4 +262,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareAddon.md b/src/VMware/VMware/help/New-AzVMwareAddon.md index c7def5fa1a04..7a07e9fe5fda 100644 --- a/src/VMware/VMware/help/New-AzVMwareAddon.md +++ b/src/VMware/VMware/help/New-AzVMwareAddon.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareaddon schema: 2.0.0 @@ -14,7 +14,7 @@ Create or update a addon in a private cloud ``` New-AzVMwareAddon -PrivateCloudName -ResourceGroupName [-SubscriptionId ] - [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` @@ -104,7 +104,7 @@ The properties of an addon resource To construct, see NOTES section for PROPERTY properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IAddonProperties +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IAddonProperties Parameter Sets: (All) Aliases: @@ -199,4 +199,3 @@ To create the parameters described below, construct a hash table containing the - `AddonType `: The type of private cloud addon ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareAddonSrmPropertiesObject.md b/src/VMware/VMware/help/New-AzVMwareAddonSrmPropertiesObject.md index 082e4edcd7d4..e2caed546386 100644 --- a/src/VMware/VMware/help/New-AzVMwareAddonSrmPropertiesObject.md +++ b/src/VMware/VMware/help/New-AzVMwareAddonSrmPropertiesObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonSrmPropertiesObject schema: 2.0.0 @@ -65,4 +65,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareAddonVrPropertiesObject.md b/src/VMware/VMware/help/New-AzVMwareAddonVrPropertiesObject.md index c4e79e44c166..1232d6c1efc9 100644 --- a/src/VMware/VMware/help/New-AzVMwareAddonVrPropertiesObject.md +++ b/src/VMware/VMware/help/New-AzVMwareAddonVrPropertiesObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareAddonVrPropertiesObject schema: 2.0.0 @@ -65,4 +65,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareAuthorization.md b/src/VMware/VMware/help/New-AzVMwareAuthorization.md index 6f49511c108e..3bfd1e39bbad 100644 --- a/src/VMware/VMware/help/New-AzVMwareAuthorization.md +++ b/src/VMware/VMware/help/New-AzVMwareAuthorization.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareauthorization schema: 2.0.0 @@ -12,12 +12,25 @@ Create or update an ExpressRoute Circuit Authorization in a private cloud ## SYNTAX +### CreateExpanded (Default) ``` New-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareAuthorization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-WhatIf] [-Confirm] [] +``` + ## DESCRIPTION Create or update an ExpressRoute Circuit Authorization in a private cloud @@ -68,12 +81,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Name Name of the ExpressRoute Circuit Authorization in the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded Aliases: AuthorizationName Required: True @@ -98,12 +127,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName The name of the private cloud. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -119,7 +164,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -134,7 +179,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -189,4 +234,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareCloudLink.md b/src/VMware/VMware/help/New-AzVMwareCloudLink.md index 61f61ec6363f..6e6fd5723909 100644 --- a/src/VMware/VMware/help/New-AzVMwareCloudLink.md +++ b/src/VMware/VMware/help/New-AzVMwareCloudLink.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecloudlink schema: 2.0.0 @@ -12,10 +12,23 @@ Create or update a cloud link in a private cloud ## SYNTAX +### CreateExpanded (Default) ``` New-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-LinkedCloud ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] - [-WhatIf] [] + [-SubscriptionId ] [-LinkedCloud ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] + [-Confirm] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareCloudLink -Name -PrivateCloudInputObject [-LinkedCloud ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareCloudLink -InputObject [-LinkedCloud ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -68,6 +81,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -LinkedCloud Identifier of the other private cloud participating in the link. @@ -88,7 +117,7 @@ Name of the cloud link resource ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded Aliases: CloudLinkName Required: True @@ -113,12 +142,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName The name of the private cloud. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -134,7 +179,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -149,7 +194,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -204,4 +249,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareCluster.md b/src/VMware/VMware/help/New-AzVMwareCluster.md index 2769554c43c7..e5709ea134b9 100644 --- a/src/VMware/VMware/help/New-AzVMwareCluster.md +++ b/src/VMware/VMware/help/New-AzVMwareCluster.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwarecluster schema: 2.0.0 @@ -12,10 +12,25 @@ Create or update a cluster in a private cloud ## SYNTAX +### CreateExpanded (Default) ``` -New-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName -SkuName - [-SubscriptionId ] [-ClusterSize ] [-PropertiesHost ] [-DefaultProfile ] - [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +New-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] -SkuName [-ClusterSize ] [-PropertiesHost ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareCluster -Name -PrivateCloudInputObject -SkuName + [-ClusterSize ] [-PropertiesHost ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] + [-Confirm] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareCluster -InputObject -SkuName [-ClusterSize ] + [-PropertiesHost ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -83,12 +98,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Name Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded Aliases: ClusterName Required: True @@ -113,12 +144,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName The name of the private cloud. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -149,7 +196,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -179,7 +226,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -234,4 +281,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareDatastore.md b/src/VMware/VMware/help/New-AzVMwareDatastore.md index b5aff9b6fa6e..222553bce20c 100644 --- a/src/VMware/VMware/help/New-AzVMwareDatastore.md +++ b/src/VMware/VMware/help/New-AzVMwareDatastore.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwaredatastore schema: 2.0.0 @@ -12,11 +12,34 @@ Create or update a datastore in a private cloud cluster ## SYNTAX +### CreateExpanded (Default) ``` New-AzVMwareDatastore -ClusterName -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DiskPoolVolumeLunName ] - [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DiskPoolVolumeLunName ] [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] + [-NetAppVolumeId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### CreateViaIdentityClusterExpanded +``` +New-AzVMwareDatastore -Name -ClusterInputObject [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareDatastore -InputObject [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -54,12 +77,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded Aliases: Required: True @@ -103,7 +142,7 @@ Accept wildcard characters: False Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.MountOptionEnum +Type: System.String Parameter Sets: (All) Aliases: @@ -129,12 +168,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Name Name of the datastore in the private cloud cluster ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded, CreateViaIdentityClusterExpanded Aliases: DatastoreName Required: True @@ -174,12 +229,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -195,7 +266,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -210,7 +281,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -265,4 +336,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareGlobalReachConnection.md b/src/VMware/VMware/help/New-AzVMwareGlobalReachConnection.md index d2a68612a2cb..45ee4acf9025 100644 --- a/src/VMware/VMware/help/New-AzVMwareGlobalReachConnection.md +++ b/src/VMware/VMware/help/New-AzVMwareGlobalReachConnection.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareglobalreachconnection schema: 2.0.0 @@ -12,13 +12,28 @@ Create or update a global reach connection in a private cloud ## SYNTAX +### CreateExpanded (Default) ``` New-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-AuthorizationKey ] [-ExpressRouteId ] - [-PeerExpressRouteResourceId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [-PeerExpressRouteResourceId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-AuthorizationKey ] [-ExpressRouteId ] [-PeerExpressRouteResourceId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwareGlobalReachConnection -InputObject [-AuthorizationKey ] + [-ExpressRouteId ] [-PeerExpressRouteResourceId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-WhatIf] [-Confirm] [] +``` + ## DESCRIPTION Create or update a global reach connection in a private cloud @@ -99,12 +114,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Name Name of the global reach connection in the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded Aliases: GlobalReachConnectionName Required: True @@ -144,12 +175,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName The name of the private cloud. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -165,7 +212,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -180,7 +227,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -235,4 +282,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareIdentitySourceObject.md b/src/VMware/VMware/help/New-AzVMwareIdentitySourceObject.md new file mode 100644 index 000000000000..d1832d3640c2 --- /dev/null +++ b/src/VMware/VMware/help/New-AzVMwareIdentitySourceObject.md @@ -0,0 +1,196 @@ +--- +external help file: Az.VMware-help.xml +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject +schema: 2.0.0 +--- + +# New-AzVMwareIdentitySourceObject + +## SYNOPSIS +Create an in-memory object for IdentitySource. + +## SYNTAX + +``` +New-AzVMwareIdentitySourceObject [-Alias ] [-BaseGroupDn ] [-BaseUserDn ] + [-Domain ] [-Name ] [-Password ] [-PrimaryServer ] [-SecondaryServer ] + [-Ssl ] [-Username ] [] +``` + +## DESCRIPTION +Create an in-memory object for IdentitySource. + +## EXAMPLES + +### EXAMPLE 1 +``` +New-AzVMwareIdentitySourceObject -Alias test +``` + +## PARAMETERS + +### -Alias +The domain's NetBIOS name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BaseGroupDn +The base distinguished name for groups. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BaseUserDn +The base distinguished name for users. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Domain +The domain's dns name. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the identity source. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Password +The password of the Active Directory user with a minimum of read-only access to Base DN for users and groups. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrimaryServer +Primary server URL. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SecondaryServer +Secondary server URL. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Ssl +Protect LDAP communication using SSL certificate (LDAPS). + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The ID of an Active Directory user with a minimum of read-only access to Base DN for users and group. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IdentitySource +## NOTES + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject](https://learn.microsoft.com/powershell/module/Az.VMware/new-azvmwareidentitysourceobject) + diff --git a/src/VMware/VMware/help/New-AzVMwarePSCredentialExecutionParameterObject.md b/src/VMware/VMware/help/New-AzVMwarePSCredentialExecutionParameterObject.md index 03877c9facd3..4311668c0ef2 100644 --- a/src/VMware/VMware/help/New-AzVMwarePSCredentialExecutionParameterObject.md +++ b/src/VMware/VMware/help/New-AzVMwarePSCredentialExecutionParameterObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwarePSCredentialExecutionParameterObject schema: 2.0.0 @@ -96,4 +96,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwarePlacementPolicy.md b/src/VMware/VMware/help/New-AzVMwarePlacementPolicy.md index 42df74ab2c26..9680aa437d16 100644 --- a/src/VMware/VMware/help/New-AzVMwarePlacementPolicy.md +++ b/src/VMware/VMware/help/New-AzVMwarePlacementPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareplacementpolicy schema: 2.0.0 @@ -12,10 +12,31 @@ Create or update a placement policy in a private cloud cluster ## SYNTAX +### CreateExpanded (Default) ``` New-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-Property ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### CreateViaIdentityPrivateCloudExpanded +``` +New-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### CreateViaIdentityClusterExpanded +``` +New-AzVMwarePlacementPolicy -Name -ClusterInputObject + [-Property ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### CreateViaIdentityExpanded +``` +New-AzVMwarePlacementPolicy -InputObject [-Property ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -68,12 +89,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded Aliases: Required: True @@ -98,12 +135,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -Name Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded, CreateViaIdentityPrivateCloudExpanded, CreateViaIdentityClusterExpanded Aliases: PlacementPolicyName Required: True @@ -128,12 +181,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: CreateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -148,7 +217,7 @@ placement policy properties To construct, see NOTES section for PROPERTY properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IPlacementPolicyProperties +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IPlacementPolicyProperties Parameter Sets: (All) Aliases: @@ -165,7 +234,7 @@ The name is case insensitive. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: True @@ -180,7 +249,7 @@ The ID of the target subscription. ```yaml Type: System.String -Parameter Sets: (All) +Parameter Sets: CreateExpanded Aliases: Required: False @@ -245,4 +314,3 @@ To create the parameters described below, construct a hash table containing the - `[State ]`: Whether the placement policy is enabled or disabled ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwarePrivateCloud.md b/src/VMware/VMware/help/New-AzVMwarePrivateCloud.md index 12532394fd63..d949a6ab2f57 100644 --- a/src/VMware/VMware/help/New-AzVMwarePrivateCloud.md +++ b/src/VMware/VMware/help/New-AzVMwarePrivateCloud.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloud schema: 2.0.0 @@ -13,10 +13,14 @@ Create or update a private cloud ## SYNTAX ``` -New-AzVMwarePrivateCloud -Name -ResourceGroupName -Location - -ManagementClusterSize -NetworkBlock -Sku [-SubscriptionId ] [-AcceptEULA] - [-Internet ] [-NsxtPassword ] [-Tag ] [-VcenterPassword ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +New-AzVMwarePrivateCloud -Name -ResourceGroupName [-SubscriptionId ] + -NetworkBlock -Sku -Location -ManagementClusterSize + [-AvailabilitySecondaryZone ] [-AvailabilityStrategy ] [-AvailabilityZone ] + [-EncryptionStatus ] [-ExtendedNetworkBlock ] [-IdentitySource ] + [-IdentityType ] [-Internet ] [-KeyVaultPropertyKeyName ] + [-KeyVaultPropertyKeyVaultUrl ] [-KeyVaultPropertyKeyVersion ] + [-ManagementClusterHost ] [-NsxtPassword ] [-Tag ] [-VcenterPassword ] + [-AcceptEULA] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -69,6 +73,51 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -AvailabilitySecondaryZone +The secondary availability zone for the private cloud + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AvailabilityStrategy +The availability strategy for the private cloud + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AvailabilityZone +The primary availability zone for the private cloud + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -DefaultProfile The credentials, account, tenant, and subscription used for communication with Azure. @@ -84,11 +133,121 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -EncryptionStatus +Status of customer managed encryption key + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedNetworkBlock +Array of additional networks noncontiguous with networkBlock. +Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. +Make sure the CIDR format conforms to (A.B.C.D/X). + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentitySource +vCenter Single Sign On Identity Sources +To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +The type of identity used for the private cloud. +The type 'SystemAssigned' refers to an implicitly created identity. +The type 'None' will remove any identities from the Private Cloud. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Internet Connectivity to internet is enabled or disabled ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyName +The name of the key. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyVaultUrl +The URL of the vault. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyVersion +The version of the key. + +```yaml +Type: System.String Parameter Sets: (All) Aliases: @@ -114,6 +273,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ManagementClusterHost +The hosts + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -ManagementClusterSize The cluster size @@ -311,4 +485,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwarePrivateCloudNsxtPassword.md b/src/VMware/VMware/help/New-AzVMwarePrivateCloudNsxtPassword.md index 11af6919fad5..5f07306e5c61 100644 --- a/src/VMware/VMware/help/New-AzVMwarePrivateCloudNsxtPassword.md +++ b/src/VMware/VMware/help/New-AzVMwarePrivateCloudNsxtPassword.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudnsxtpassword schema: 2.0.0 @@ -15,14 +15,14 @@ Rotate the NSX-T Manager password ### Rotate (Default) ``` New-AzVMwarePrivateCloudNsxtPassword -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### RotateViaIdentity ``` New-AzVMwarePrivateCloudNsxtPassword -InputObject [-DefaultProfile ] [-AsJob] - [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -244,4 +244,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwarePrivateCloudVcenterPassword.md b/src/VMware/VMware/help/New-AzVMwarePrivateCloudVcenterPassword.md index 1670111bc5d9..fcb5f166e69f 100644 --- a/src/VMware/VMware/help/New-AzVMwarePrivateCloudVcenterPassword.md +++ b/src/VMware/VMware/help/New-AzVMwarePrivateCloudVcenterPassword.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/new-azvmwareprivatecloudvcenterpassword schema: 2.0.0 @@ -15,14 +15,14 @@ Rotate the vCenter password ### Rotate (Default) ``` New-AzVMwarePrivateCloudVcenterPassword -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### RotateViaIdentity ``` New-AzVMwarePrivateCloudVcenterPassword -InputObject [-DefaultProfile ] [-AsJob] - [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -244,4 +244,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md b/src/VMware/VMware/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md index ee04e5f72401..b4344ec226ae 100644 --- a/src/VMware/VMware/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md +++ b/src/VMware/VMware/help/New-AzVMwareScriptSecureStringExecutionParameterObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptSecureStringExecutionParameterObject schema: 2.0.0 @@ -81,4 +81,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareScriptStringExecutionParameterObject.md b/src/VMware/VMware/help/New-AzVMwareScriptStringExecutionParameterObject.md index 5163c8cf03bf..0da7647fa56d 100644 --- a/src/VMware/VMware/help/New-AzVMwareScriptStringExecutionParameterObject.md +++ b/src/VMware/VMware/help/New-AzVMwareScriptStringExecutionParameterObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareScriptStringExecutionParameterObject schema: 2.0.0 @@ -80,4 +80,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md b/src/VMware/VMware/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md index 0135b234b011..18c361bd2a33 100644 --- a/src/VMware/VMware/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md +++ b/src/VMware/VMware/help/New-AzVMwareVMPlacementPolicyPropertiesObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVMPlacementPolicyPropertiesObject schema: 2.0.0 @@ -13,8 +13,8 @@ Create an in-memory object for VMPlacementPolicyProperties. ## SYNTAX ``` -New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType -Type - -VMMember [-DisplayName ] [-State ] [] +New-AzVMwareVMPlacementPolicyPropertiesObject -AffinityType -VMMember -Type + [-DisplayName ] [-State ] [] ``` ## DESCRIPTION @@ -41,7 +41,7 @@ Create an in-memory object for VMPlacementPolicyProperties. placement policy affinity type. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType +Type: System.String Parameter Sets: (All) Aliases: @@ -71,7 +71,7 @@ Accept wildcard characters: False Whether the placement policy is enabled or disabled. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState +Type: System.String Parameter Sets: (All) Aliases: @@ -86,7 +86,7 @@ Accept wildcard characters: False placement policy type. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType +Type: System.String Parameter Sets: (All) Aliases: @@ -126,4 +126,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md b/src/VMware/VMware/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md index cf398262af1e..56df4aed9604 100644 --- a/src/VMware/VMware/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md +++ b/src/VMware/VMware/help/New-AzVMwareVmHostPlacementPolicyPropertiesObject.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.VMware/new-AzVMwareVmHostPlacementPolicyPropertiesObject schema: 2.0.0 @@ -13,9 +13,8 @@ Create an in-memory object for VmHostPlacementPolicyProperties. ## SYNTAX ``` -New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType -HostMember - -Type -VMMember [-DisplayName ] [-State ] - [] +New-AzVMwareVmHostPlacementPolicyPropertiesObject -AffinityType -HostMember + -VMMember -Type [-DisplayName ] [-State ] [] ``` ## DESCRIPTION @@ -42,7 +41,7 @@ Create an in-memory object for VmHostPlacementPolicyProperties. placement policy affinity type. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AffinityType +Type: System.String Parameter Sets: (All) Aliases: @@ -87,7 +86,7 @@ Accept wildcard characters: False Whether the placement policy is enabled or disabled. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState +Type: System.String Parameter Sets: (All) Aliases: @@ -102,7 +101,7 @@ Accept wildcard characters: False placement policy type. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyType +Type: System.String Parameter Sets: (All) Aliases: @@ -142,4 +141,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwareAddon.md b/src/VMware/VMware/help/Remove-AzVMwareAddon.md index f8b3fa0ff271..fc472f9a25c3 100644 --- a/src/VMware/VMware/help/Remove-AzVMwareAddon.md +++ b/src/VMware/VMware/help/Remove-AzVMwareAddon.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareaddon schema: 2.0.0 @@ -15,14 +15,14 @@ Delete a addon in a private cloud ### Delete (Default) ``` Remove-AzVMwareAddon -AddonType -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` -Remove-AzVMwareAddon -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] +Remove-AzVMwareAddon -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,7 +33,6 @@ Delete a addon in a private cloud ### Example 1: Delete an addon in a private cloud ```powershell Remove-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group - ``` Delete an addon in a private cloud @@ -41,7 +40,6 @@ Delete an addon in a private cloud ### Example 2: Delete an addon in a private cloud ```powershell Get-AzVMwareAddon -AddonType vr -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareAddon - ``` Delete an addon in a private cloud @@ -264,4 +262,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwareAuthorization.md b/src/VMware/VMware/help/Remove-AzVMwareAuthorization.md index add5b6a3a7df..5506c5770622 100644 --- a/src/VMware/VMware/help/Remove-AzVMwareAuthorization.md +++ b/src/VMware/VMware/help/Remove-AzVMwareAuthorization.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareauthorization schema: 2.0.0 @@ -15,14 +15,20 @@ Delete an ExpressRoute Circuit Authorization in a private cloud ### Delete (Default) ``` Remove-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] +``` + ### DeleteViaIdentity ``` Remove-AzVMwareAuthorization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,7 +39,6 @@ Delete an ExpressRoute Circuit Authorization in a private cloud ### Example 1: Delete authorization in private cloud ```powershell Remove-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_authorization - ``` Delete authorization in private cloud @@ -41,7 +46,6 @@ Delete authorization in private cloud ### Example 2: Delete authorization in private cloud ```powershell Get-AzVMwareAuthorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_authorization | Remove-AzVMwareAuthorization - ``` Delete authorization in private cloud @@ -99,7 +103,7 @@ Name of the ExpressRoute Circuit Authorization in the private cloud ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud Aliases: AuthorizationName Required: True @@ -139,6 +143,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -264,4 +284,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwareCloudLink.md b/src/VMware/VMware/help/Remove-AzVMwareCloudLink.md index c9440dbafda0..8dc473478057 100644 --- a/src/VMware/VMware/help/Remove-AzVMwareCloudLink.md +++ b/src/VMware/VMware/help/Remove-AzVMwareCloudLink.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecloudlink schema: 2.0.0 @@ -15,14 +15,20 @@ Delete a cloud link in a private cloud ### Delete (Default) ``` Remove-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareCloudLink -Name -PrivateCloudInputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] +``` + ### DeleteViaIdentity ``` Remove-AzVMwareCloudLink -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,7 +39,6 @@ Delete a cloud link in a private cloud ### Example 1: Delete a cloud link ```powershell Remove-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group - ``` Delete a cloud link @@ -41,7 +46,6 @@ Delete a cloud link ### Example 2: Delete a cloud link ```powershell Get-AzVMwareCloudLink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -Name azps_test_cloudlink | Remove-AzVMwareCloudLink - ``` Delete a cloud link @@ -99,7 +103,7 @@ Name of the cloud link resource ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud Aliases: CloudLinkName Required: True @@ -139,6 +143,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -264,4 +284,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwareCluster.md b/src/VMware/VMware/help/Remove-AzVMwareCluster.md index 9537b2b1df2e..e88594c2a6e5 100644 --- a/src/VMware/VMware/help/Remove-AzVMwareCluster.md +++ b/src/VMware/VMware/help/Remove-AzVMwareCluster.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwarecluster schema: 2.0.0 @@ -15,14 +15,20 @@ Delete a cluster in a private cloud ### Delete (Default) ``` Remove-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareCluster -Name -PrivateCloudInputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] +``` + ### DeleteViaIdentity ``` Remove-AzVMwareCluster -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,7 +39,6 @@ Delete a cluster in a private cloud ### Example 1: Delete cluster in private cloud ```powershell Remove-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group - ``` Delete cluster in private cloud @@ -41,7 +46,6 @@ Delete cluster in private cloud ### Example 2: Delete cluster in private cloud ```powershell Get-AzVMwareCluster -Name azps_test_cluster -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareCluster - ``` Delete cluster in private cloud @@ -99,7 +103,7 @@ Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud Aliases: ClusterName Required: True @@ -139,6 +143,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -264,4 +284,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwareDatastore.md b/src/VMware/VMware/help/Remove-AzVMwareDatastore.md index ba5f35b91ff0..e80ad4c670ad 100644 --- a/src/VMware/VMware/help/Remove-AzVMwareDatastore.md +++ b/src/VMware/VMware/help/Remove-AzVMwareDatastore.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwaredatastore schema: 2.0.0 @@ -16,13 +16,25 @@ Delete a datastore in a private cloud cluster ``` Remove-AzVMwareDatastore -ClusterName -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### DeleteViaIdentityCluster +``` +Remove-AzVMwareDatastore -Name -ClusterInputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzVMwareDatastore -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -61,12 +73,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud Aliases: Required: True @@ -112,7 +140,7 @@ Name of the datastore in the private cloud cluster ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud, DeleteViaIdentityCluster Aliases: DatastoreName Required: True @@ -152,6 +180,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -277,4 +321,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwareGlobalReachConnection.md b/src/VMware/VMware/help/Remove-AzVMwareGlobalReachConnection.md index 1d382067665c..b5180c9f2ed0 100644 --- a/src/VMware/VMware/help/Remove-AzVMwareGlobalReachConnection.md +++ b/src/VMware/VMware/help/Remove-AzVMwareGlobalReachConnection.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareglobalreachconnection schema: 2.0.0 @@ -15,14 +15,20 @@ Delete a global reach connection in a private cloud ### Delete (Default) ``` Remove-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName - [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] +``` + ### DeleteViaIdentity ``` Remove-AzVMwareGlobalReachConnection -InputObject [-DefaultProfile ] [-AsJob] - [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,7 +39,6 @@ Delete a global reach connection in a private cloud ### Example 1: Delete a global reach connection in a private cloud ```powershell Remove-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group - ``` Delete a global reach connection in a private cloud @@ -41,7 +46,6 @@ Delete a global reach connection in a private cloud ### Example 2: Delete a global reach connection in a private cloud ```powershell Get-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group | Remove-AzVMwareGlobalReachConnection - ``` Delete a global reach connection in a private cloud @@ -99,7 +103,7 @@ Name of the global reach connection in the private cloud ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud Aliases: GlobalReachConnectionName Required: True @@ -139,6 +143,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -264,4 +284,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwarePlacementPolicy.md b/src/VMware/VMware/help/Remove-AzVMwarePlacementPolicy.md index 5158109ff798..e919450f33e9 100644 --- a/src/VMware/VMware/help/Remove-AzVMwarePlacementPolicy.md +++ b/src/VMware/VMware/help/Remove-AzVMwarePlacementPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareplacementpolicy schema: 2.0.0 @@ -16,13 +16,25 @@ Delete a placement policy in a private cloud cluster ``` Remove-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### DeleteViaIdentityPrivateCloud +``` +Remove-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### DeleteViaIdentityCluster +``` +Remove-AzVMwarePlacementPolicy -Name -ClusterInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzVMwarePlacementPolicy -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -33,7 +45,6 @@ Delete a placement policy in a private cloud cluster ### Example 1: Delete a placement policy in a private cloud cluster ```powershell Remove-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 - ``` Delete a placement policy in a private cloud cluster @@ -41,7 +52,6 @@ Delete a placement policy in a private cloud cluster ### Example 2: Delete a placement policy in a private cloud cluster ```powershell Get-AzVMwarePlacementPolicy -ClusterName cluster1 -Name policy1 -PrivateCloudName cloud1 -ResourceGroupName group1 | Remove-AzVMwarePlacementPolicy - ``` Delete a placement policy in a private cloud cluster @@ -63,12 +73,28 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityCluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud Aliases: Required: True @@ -114,7 +140,7 @@ Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy ```yaml Type: System.String -Parameter Sets: Delete +Parameter Sets: Delete, DeleteViaIdentityPrivateCloud, DeleteViaIdentityCluster Aliases: PlacementPolicyName Required: True @@ -154,6 +180,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: DeleteViaIdentityPrivateCloud +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -279,4 +321,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Remove-AzVMwarePrivateCloud.md b/src/VMware/VMware/help/Remove-AzVMwarePrivateCloud.md index 6ce39695e9c9..01341b81d5ed 100644 --- a/src/VMware/VMware/help/Remove-AzVMwarePrivateCloud.md +++ b/src/VMware/VMware/help/Remove-AzVMwarePrivateCloud.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/remove-azvmwareprivatecloud schema: 2.0.0 @@ -15,13 +15,13 @@ Delete a private cloud ### Delete (Default) ``` Remove-AzVMwarePrivateCloud -Name -ResourceGroupName [-SubscriptionId ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-WhatIf] [-Confirm] [] ``` ### DeleteViaIdentity ``` Remove-AzVMwarePrivateCloud -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] - [-PassThru] [-Confirm] [-WhatIf] [] + [-PassThru] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -32,7 +32,6 @@ Delete a private cloud ### Example 1: Delete private cloud ```powershell Remove-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud - ``` Delete private cloud @@ -40,7 +39,6 @@ Delete private cloud ### Example 2: Delete private cloud ```powershell Get-AzVMwarePrivateCloud -ResourceGroupName azps_test_group -Name azps_test_cloud | Remove-AzVMwarePrivateCloud - ``` Delete private cloud @@ -248,4 +246,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Test-AzVMwareLocationQuotaAvailability.md b/src/VMware/VMware/help/Test-AzVMwareLocationQuotaAvailability.md index 1a2d23aa4cb9..749cc75e3466 100644 --- a/src/VMware/VMware/help/Test-AzVMwareLocationQuotaAvailability.md +++ b/src/VMware/VMware/help/Test-AzVMwareLocationQuotaAvailability.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationquotaavailability schema: 2.0.0 @@ -14,7 +14,7 @@ Return quota for subscription by region ``` Test-AzVMwareLocationQuotaAvailability -Location [-SubscriptionId ] - [-DefaultProfile ] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -127,4 +127,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Test-AzVMwareLocationTrialAvailability.md b/src/VMware/VMware/help/Test-AzVMwareLocationTrialAvailability.md index 89f73a8c2e0e..f0ab9407a21f 100644 --- a/src/VMware/VMware/help/Test-AzVMwareLocationTrialAvailability.md +++ b/src/VMware/VMware/help/Test-AzVMwareLocationTrialAvailability.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/test-azvmwarelocationtrialavailability schema: 2.0.0 @@ -13,8 +13,8 @@ Return trial status for subscription by region ## SYNTAX ``` -Test-AzVMwareLocationTrialAvailability -Location [-SubscriptionId ] - [-DefaultProfile ] [-Confirm] [-WhatIf] [] +Test-AzVMwareLocationTrialAvailability -Location [-SubscriptionId ] [-Name ] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -67,6 +67,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Name +The name of the SKU. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -SubscriptionId The ID of the target subscription. @@ -127,4 +142,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ALIASES ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Update-AzVMwareAuthorization.md b/src/VMware/VMware/help/Update-AzVMwareAuthorization.md new file mode 100644 index 000000000000..1f210ffe2796 --- /dev/null +++ b/src/VMware/VMware/help/Update-AzVMwareAuthorization.md @@ -0,0 +1,308 @@ +--- +external help file: Az.VMware-help.xml +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareauthorization +schema: 2.0.0 +--- + +# Update-AzVMwareAuthorization + +## SYNOPSIS +Create an ExpressRoute Circuit Authorization in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareAuthorization -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareAuthorization -Name -PrivateCloudInputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareAuthorization -InputObject [-DefaultProfile ] [-AsJob] [-NoWait] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Create an ExpressRoute Circuit Authorization in a private cloud + +## EXAMPLES + +### EXAMPLE 1 +``` +Update-AzVMwareAuthorization -Name azps_test_authorization -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the ExpressRoute Circuit Authorization in the private cloud + +```yaml +Type: String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: AuthorizationName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IExpressRouteAuthorization +## NOTES +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareauthorization](https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareauthorization) + diff --git a/src/VMware/VMware/help/Update-AzVMwareCloudLink.md b/src/VMware/VMware/help/Update-AzVMwareCloudLink.md new file mode 100644 index 000000000000..a9dd6bee4d7e --- /dev/null +++ b/src/VMware/VMware/help/Update-AzVMwareCloudLink.md @@ -0,0 +1,323 @@ +--- +external help file: Az.VMware-help.xml +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecloudlink +schema: 2.0.0 +--- + +# Update-AzVMwareCloudLink + +## SYNOPSIS +Create a cloud link in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareCloudLink -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-LinkedCloud ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] + [-Confirm] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareCloudLink -Name -PrivateCloudInputObject [-LinkedCloud ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareCloudLink -InputObject [-LinkedCloud ] [-DefaultProfile ] + [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Create a cloud link in a private cloud + +## EXAMPLES + +### EXAMPLE 1 +``` +Update-AzVMwareCloudLink -Name azps_test_cloudlink -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -LinkedCloud "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/azps_test_group2/providers/Microsoft.AVS/privateClouds/azps_test_cloud2/" +``` + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LinkedCloud +Identifier of the other private cloud participating in the link. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the cloud link resource + +```yaml +Type: String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: CloudLinkName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.ICloudLink +## NOTES +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecloudlink](https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecloudlink) + diff --git a/src/VMware/VMware/help/Update-AzVMwareCluster.md b/src/VMware/VMware/help/Update-AzVMwareCluster.md index 8b5f97025ec6..d74ac532dd13 100644 --- a/src/VMware/VMware/help/Update-AzVMwareCluster.md +++ b/src/VMware/VMware/help/Update-AzVMwareCluster.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwarecluster schema: 2.0.0 @@ -16,13 +16,20 @@ Update a cluster in a private cloud ``` Update-AzVMwareCluster -Name -PrivateCloudName -ResourceGroupName [-SubscriptionId ] [-ClusterSize ] [-PropertiesHost ] [-DefaultProfile ] - [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareCluster -Name -PrivateCloudInputObject [-ClusterSize ] + [-PropertiesHost ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] ``` ### UpdateViaIdentityExpanded ``` Update-AzVMwareCluster -InputObject [-ClusterSize ] [-PropertiesHost ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -124,7 +131,7 @@ Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded Aliases: ClusterName Required: True @@ -149,6 +156,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -289,4 +312,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Update-AzVMwareDatastore.md b/src/VMware/VMware/help/Update-AzVMwareDatastore.md new file mode 100644 index 000000000000..6460bd872524 --- /dev/null +++ b/src/VMware/VMware/help/Update-AzVMwareDatastore.md @@ -0,0 +1,447 @@ +--- +external help file: Az.VMware-help.xml +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwaredatastore +schema: 2.0.0 +--- + +# Update-AzVMwareDatastore + +## SYNOPSIS +Create a datastore in a private cloud cluster + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareDatastore -ClusterName -Name -PrivateCloudName + -ResourceGroupName [-SubscriptionId ] [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareDatastore -ClusterName -Name -PrivateCloudInputObject + [-DiskPoolVolumeLunName ] [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] + [-NetAppVolumeId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaIdentityClusterExpanded +``` +Update-AzVMwareDatastore -Name -ClusterInputObject [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareDatastore -InputObject [-DiskPoolVolumeLunName ] + [-DiskPoolVolumeMountOption ] [-DiskPoolVolumeTargetId ] [-NetAppVolumeId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Create a datastore in a private cloud cluster + +## EXAMPLES + +### EXAMPLE 1 +``` +Update-AzVMwareDatastore -ClusterName azps_test_cluster -Name azps_test_datastore -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group -NetAppVolumeId "/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/azps_test_group/providers/Microsoft.NetApp/netAppAccounts/NetAppAccount1/capacityPools/CapacityPool1/volumes/NFSVol1" +``` + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ClusterName +Name of the cluster in the private cloud + +```yaml +Type: String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeLunName +Name of the LUN to be used for datastore + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeMountOption +Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DiskPoolVolumeTargetId +Azure resource ID of the iSCSI target + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the datastore in the private cloud cluster + +```yaml +Type: String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded, UpdateViaIdentityClusterExpanded +Aliases: DatastoreName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetAppVolumeId +Azure resource ID of the NetApp volume + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +Name of the private cloud + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IDatastore +## NOTES +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +CLUSTERINPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +INPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwaredatastore](https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwaredatastore) + diff --git a/src/VMware/VMware/help/Update-AzVMwareGlobalReachConnection.md b/src/VMware/VMware/help/Update-AzVMwareGlobalReachConnection.md new file mode 100644 index 000000000000..f80ae1e96b4d --- /dev/null +++ b/src/VMware/VMware/help/Update-AzVMwareGlobalReachConnection.md @@ -0,0 +1,356 @@ +--- +external help file: Az.VMware-help.xml +Module Name: Az.VMware +online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareglobalreachconnection +schema: 2.0.0 +--- + +# Update-AzVMwareGlobalReachConnection + +## SYNOPSIS +Create a global reach connection in a private cloud + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzVMwareGlobalReachConnection -Name -PrivateCloudName -ResourceGroupName + [-SubscriptionId ] [-AuthorizationKey ] [-ExpressRouteId ] + [-PeerExpressRouteCircuit ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwareGlobalReachConnection -Name -PrivateCloudInputObject + [-AuthorizationKey ] [-ExpressRouteId ] [-PeerExpressRouteCircuit ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzVMwareGlobalReachConnection -InputObject [-AuthorizationKey ] + [-ExpressRouteId ] [-PeerExpressRouteCircuit ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Create a global reach connection in a private cloud + +## EXAMPLES + +### EXAMPLE 1 +``` +Update-AzVMwareGlobalReachConnection -Name azps_test_grc -PrivateCloudName azps_test_cloud -ResourceGroupName azps_test_group +``` + +## PARAMETERS + +### -AsJob +Run the command as a job + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AuthorizationKey +Authorization key from the peer express route used for the global reach connection + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The DefaultProfile parameter is not functional. +Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. + +```yaml +Type: PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExpressRouteId +The ID of the Private Cloud's ExpressRoute Circuit that is participating in the global reach connection + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +Name of the global reach connection in the private cloud + +```yaml +Type: String +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded +Aliases: GlobalReachConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PeerExpressRouteCircuit +Identifier of the ExpressRoute Circuit to peer with in the global reach connection + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PrivateCloudName +The name of the private cloud. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group. +The name is case insensitive. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IGlobalReachConnection +## NOTES +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. +For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +PRIVATECLOUDINPUTOBJECT \: Identity Parameter + \[AddonName \\]: Name of the addon for the private cloud + \[AuthorizationName \\]: Name of the ExpressRoute Circuit Authorization in the private cloud + \[CloudLinkName \\]: Name of the cloud link resource + \[ClusterName \\]: Name of the cluster in the private cloud + \[DatastoreName \\]: Name of the datastore in the private cloud cluster + \[DhcpId \\]: NSX DHCP identifier. +Generally the same as the DHCP display name + \[DnsServiceId \\]: NSX DNS Service identifier. +Generally the same as the DNS Service's display name + \[DnsZoneId \\]: NSX DNS Zone identifier. +Generally the same as the DNS Zone's display name + \[GatewayId \\]: NSX Gateway identifier. +Generally the same as the Gateway's display name + \[GlobalReachConnectionName \\]: Name of the global reach connection in the private cloud + \[HcxEnterpriseSiteName \\]: Name of the HCX Enterprise Site in the private cloud + \[Id \\]: Resource identity path + \[Location \\]: Azure region + \[PlacementPolicyName \\]: Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy + \[PortMirroringId \\]: NSX Port Mirroring identifier. +Generally the same as the Port Mirroring display name + \[PrivateCloudName \\]: Name of the private cloud + \[PublicIPId \\]: NSX Public IP Block identifier. +Generally the same as the Public IP Block's display name + \[ResourceGroupName \\]: The name of the resource group. +The name is case insensitive. + \[ScriptCmdletName \\]: Name of the script cmdlet resource in the script package in the private cloud + \[ScriptExecutionName \\]: Name of the user-invoked script execution resource + \[ScriptPackageName \\]: Name of the script package in the private cloud + \[SegmentId \\]: NSX Segment identifier. +Generally the same as the Segment's display name + \[SubscriptionId \\]: The ID of the target subscription. + \[VMGroupId \\]: NSX VM Group identifier. +Generally the same as the VM Group's display name + \[VirtualMachineId \\]: Virtual Machine identifier + \[WorkloadNetworkName \\]: Name for the workload network in the private cloud + +## RELATED LINKS + +[https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareglobalreachconnection](https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareglobalreachconnection) + diff --git a/src/VMware/VMware/help/Update-AzVMwarePlacementPolicy.md b/src/VMware/VMware/help/Update-AzVMwarePlacementPolicy.md index ba2ec8bf698b..85d93e7c86fd 100644 --- a/src/VMware/VMware/help/Update-AzVMwarePlacementPolicy.md +++ b/src/VMware/VMware/help/Update-AzVMwarePlacementPolicy.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareplacementpolicy schema: 2.0.0 @@ -15,16 +15,32 @@ Update a placement policy in a private cloud cluster ### UpdateExpanded (Default) ``` Update-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudName - -ResourceGroupName [-SubscriptionId ] [-HostMember ] - [-State ] [-VMMember ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] + -ResourceGroupName [-SubscriptionId ] [-AffinityStrength ] + [-AzureHybridBenefitType ] [-HostMember ] [-State ] [-VMMember ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] +``` + +### UpdateViaIdentityPrivateCloudExpanded +``` +Update-AzVMwarePlacementPolicy -ClusterName -Name -PrivateCloudInputObject + [-AffinityStrength ] [-AzureHybridBenefitType ] [-HostMember ] [-State ] + [-VMMember ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] +``` + +### UpdateViaIdentityClusterExpanded +``` +Update-AzVMwarePlacementPolicy -Name -ClusterInputObject + [-AffinityStrength ] [-AzureHybridBenefitType ] [-HostMember ] [-State ] + [-VMMember ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] + [] ``` ### UpdateViaIdentityExpanded ``` -Update-AzVMwarePlacementPolicy -InputObject [-HostMember ] - [-State ] [-VMMember ] [-DefaultProfile ] [-AsJob] [-NoWait] - [-Confirm] [-WhatIf] [] +Update-AzVMwarePlacementPolicy -InputObject [-AffinityStrength ] + [-AzureHybridBenefitType ] [-HostMember ] [-State ] [-VMMember ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -60,6 +76,21 @@ Update a placement policy in a private cloud cluster ## PARAMETERS +### -AffinityStrength +vm-host placement policy affinity strength (should/must) + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -AsJob Run the command as a job @@ -75,12 +106,43 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -AzureHybridBenefitType +placement policy azure hybrid benefit opt-in type + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ClusterInputObject +Identity Parameter +To construct, see NOTES section for CLUSTERINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityClusterExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -ClusterName Name of the cluster in the private cloud ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded Aliases: Required: True @@ -141,7 +203,7 @@ Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy ```yaml Type: System.String -Parameter Sets: UpdateExpanded +Parameter Sets: UpdateExpanded, UpdateViaIdentityPrivateCloudExpanded, UpdateViaIdentityClusterExpanded Aliases: PlacementPolicyName Required: True @@ -166,6 +228,22 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -PrivateCloudInputObject +Identity Parameter +To construct, see NOTES section for PRIVATECLOUDINPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IVMwareIdentity +Parameter Sets: UpdateViaIdentityPrivateCloudExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + ### -PrivateCloudName Name of the private cloud @@ -201,7 +279,7 @@ Accept wildcard characters: False Whether the placement policy is enabled or disabled ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.PlacementPolicyState +Type: System.String Parameter Sets: (All) Aliases: @@ -321,4 +399,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS - diff --git a/src/VMware/VMware/help/Update-AzVMwarePrivateCloud.md b/src/VMware/VMware/help/Update-AzVMwarePrivateCloud.md index 3880da925ad4..495c63b72a04 100644 --- a/src/VMware/VMware/help/Update-AzVMwarePrivateCloud.md +++ b/src/VMware/VMware/help/Update-AzVMwarePrivateCloud.md @@ -1,5 +1,5 @@ --- -external help file: +external help file: Az.VMware-help.xml Module Name: Az.VMware online version: https://learn.microsoft.com/powershell/module/az.vmware/update-azvmwareprivatecloud schema: 2.0.0 @@ -15,23 +15,20 @@ Update a private cloud ### UpdateExpanded (Default) ``` Update-AzVMwarePrivateCloud -Name -ResourceGroupName [-SubscriptionId ] - [-AvailabilitySecondaryZone ] [-AvailabilityStrategy ] - [-AvailabilityZone ] [-EncryptionStatus ] [-IdentitySource ] - [-IdentityType ] [-Internet ] [-KeyVaultPropertyKeyName ] + [-EncryptionStatus ] [-ExtendedNetworkBlock ] [-IdentitySource ] + [-IdentityType ] [-Internet ] [-KeyVaultPropertyKeyName ] [-KeyVaultPropertyKeyVaultUrl ] [-KeyVaultPropertyKeyVersion ] [-ManagementClusterHost ] [-ManagementClusterSize ] [-Tag ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] + [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ### UpdateViaIdentityExpanded ``` -Update-AzVMwarePrivateCloud -InputObject [-AvailabilitySecondaryZone ] - [-AvailabilityStrategy ] [-AvailabilityZone ] - [-EncryptionStatus ] [-IdentitySource ] - [-IdentityType ] [-Internet ] [-KeyVaultPropertyKeyName ] - [-KeyVaultPropertyKeyVaultUrl ] [-KeyVaultPropertyKeyVersion ] - [-ManagementClusterHost ] [-ManagementClusterSize ] [-Tag ] - [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +Update-AzVMwarePrivateCloud -InputObject [-EncryptionStatus ] + [-ExtendedNetworkBlock ] [-IdentitySource ] [-IdentityType ] + [-Internet ] [-KeyVaultPropertyKeyName ] [-KeyVaultPropertyKeyVaultUrl ] + [-KeyVaultPropertyKeyVersion ] [-ManagementClusterHost ] [-ManagementClusterSize ] + [-Tag ] [-DefaultProfile ] [-AsJob] [-NoWait] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -82,28 +79,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -AvailabilitySecondaryZone -The secondary availability zone for the private cloud - -```yaml -Type: System.Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -AvailabilityStrategy -The availability strategy for the private cloud +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.AvailabilityStrategy +Type: System.Management.Automation.PSObject Parameter Sets: (All) -Aliases: +Aliases: AzureRMContext, AzureCredential Required: False Position: Named @@ -112,11 +94,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -AvailabilityZone -The primary availability zone for the private cloud +### -EncryptionStatus +Status of customer managed encryption key ```yaml -Type: System.Int32 +Type: System.String Parameter Sets: (All) Aliases: @@ -127,26 +109,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -DefaultProfile -The credentials, account, tenant, and subscription used for communication with Azure. - -```yaml -Type: System.Management.Automation.PSObject -Parameter Sets: (All) -Aliases: AzureRMContext, AzureCredential - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -EncryptionStatus -Status of customer managed encryption key +### -ExtendedNetworkBlock +Array of additional networks noncontiguous with networkBlock. +Networks must be unique and non-overlapping across VNet in your subscription, on-premise, and this privateCloud networkBlock attribute. +Make sure the CIDR format conforms to (A.B.C.D/X). ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.EncryptionState +Type: System.String[] Parameter Sets: (All) Aliases: @@ -162,7 +131,7 @@ vCenter Single Sign On Identity Sources To construct, see NOTES section for IDENTITYSOURCE properties and create a hash table. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.Api20211201.IIdentitySource[] +Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Models.IIdentitySource[] Parameter Sets: (All) Aliases: @@ -179,7 +148,7 @@ The type 'SystemAssigned' refers to an implicitly created identity. The type 'None' will remove any identities from the Private Cloud. ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.ResourceIdentityType +Type: System.String Parameter Sets: (All) Aliases: @@ -210,7 +179,7 @@ Accept wildcard characters: False Connectivity to internet is enabled or disabled ```yaml -Type: Microsoft.Azure.PowerShell.Cmdlets.VMware.Support.InternetEnum +Type: System.String Parameter Sets: (All) Aliases: @@ -463,4 +432,3 @@ To create the parameters described below, construct a hash table containing the - `[VirtualMachineId ]`: Virtual Machine identifier ## RELATED LINKS -